Yacker
Metallic
I'm new to Lua of course and most of my knowledge comes from looking at the wiki, and other scripts, but I can't figure out what is wrong with my script, no matter how hard I try. Can anyone identify the issue?
It errors at line 37 for "attempting to perform arithmetic on field 'customtimer' (a nil value)" even though I set that to 0 earlier in the script. What could the issue be?
Code:
addHook("ThinkFrame", do
for player in players.iterate
if player.reset == false
player.customtimer = 0
player.reset = true
end
end
end)
addHook("MobjThinker", function(player)
if player.state == S_PLAY_STND then
player.customtimer = player.customtimer + 1
if player.customtimer < 13 then
player.frame = U
end
if player.customtimer > 12 and player.customtimer < 15 then
player.frame = U
end
if player.customtimer > 14 and player.customtimer < 27 then
player.frame = V
end
if player.customtimer > 26 and player.customtimer < 29 then
player.frame = U
end
if player.customtimer == 28 player.customtimer = 0
else
player.customtimer = 0
end
end
end, MT_PLAYER)
It errors at line 37 for "attempting to perform arithmetic on field 'customtimer' (a nil value)" even though I set that to 0 earlier in the script. What could the issue be?