I made a script which saves the heroes in super hero script. What it exactly does is write the player heroes in a file with his USGN. Something Like this :
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
function initArray(m) 	local initArray = {} 	for i = 1, m do 		initArray[i] = 0 	end 	return initArray end heroes_name = {"Hulk","Flash","Spiderman"} heroes = initArray(32*3) -- 32 is the max players and 3 is the number of heroes which exists. Then when the player with usgn 94235 sellects the Flash hero it will write the following in 94235.cfg : heroes[3 * id + 2 ]=1 3 is number of heroes, id is the id of player and 2 is the hero which player select. The 2nd one, flash.
Then what i want to do is a type of dofile which loads the id.
1
2
3
4
5
6
7
2
3
4
5
6
7
Imagine that i join. My usgn is 94235. addhook("join","loadheroes") function loadheroes(id) dofile("sys/lua/superhero/saves/"..player(id,"usgn")..".cfg") end It will do the file called 94235.cfg which actually contains this : heroes[3 * id + 2]=1
But the problem is that the id parameter in the file will not work. Then my question is if there's a way to read something and execute it but with id parameter. In this case the id must be the id of who join.
Anyway thanks for reading.