Basically what i'm trying to do here is make it to where the player with an id of 1 (Usually me when i start up the local server) gains 4 points of Kevlar armor per second up until the armor count reaches 100, then it stops
But it doesn't even start to begin with, it remains at zero
I checked the console, but nothing was wrong, i tried a bit of manual debugging but it seems to be successfully adding armor, but i'm not getting it
I checked my id in the game, it's always been 1
But yet it doesn't work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
------------
-- CONFIG --
------------
	
	AP = 4 -- how many Armor Points will be added per second
------------
if second==nil then second={} end
second={}
addhook("second", "every_second")
function every_second()
	PlayerID = 1 -- Player's ingame id
	PlayerArmor = player(1, "armor") -- Player's current armor
	AddArmor = player(1, "armor")+AP -- Simple AP calculator
	 if PlayerArmor ~= 100 then -- Stops charging at 100
	 parse ("setarmor "..PlayerID.." AddArmor") -- Finishes math
	 end
end
Thanks for any help i can get
(By the way, it's a modified "Gradual Healing" code i saw on this site once, not that i couldn't eventually learn to make it by myself)
Armor regen script is not adding armor
1 
Offline
SpartanWar118
You are running a dedicated server and the player with ID 1 doesn't exist