How to realize in Lua resets the timer? I want to write a script for entity local timer which is reset every 2 seconds. To check, I typed "prompt" to "follow" the timer. But the timer is not reset. Please help.
local timer = 0
function timer_init(e)
end
function timer_main(e)
if timer == 0 then
StartTimer(e)
timer = 1
if timer == 1 and GetTimer(e) > 2000 then
timer = 0
end
end
Prompt("timer " .. GetTimer(e))
end