If player has USGN 15476 (me) then when he uses left atack he spawns items or other projectiles. THIS part is working.
If player has USGN 15476 (also me) he gets healed back to 100 health every second) When I start server the hooks are added no errors occur and the projectile part works. Then via console I slap myself few times however I DO NOT heal back to 100 HP back. Could any of you tell me what I did/wrote wrong ? Knowing me.. I added a lot of unneeded stuff that might be pointless but I just try to make everything work. I would be VERY thankful if you could point out (at least) my mistake or fix the code. Thank you in advance.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end bombs = initArray(32) health = initArray(32) addhook("attack2","bomb") function bomb(id) if (bombs[id]==1) then if player(id,"usgn") == 15476 then 	for i=0,315,45 do 		parse("spawnprojectile "..id.." 45 "..player(id,"x").." "..player(id,"y").." 1000 "..i) end end end end addhook("spawn","starting") function starting(id) bombs[id] = 1 health[id] = 1 end addhook("second","rehealth") function rehealth() if (health[id]==1) then if player(id,"usgn") == 15476 then parse("sethealth "..id.." 100") end end end