So, while learning LUA I wrote a simple script. The point is you can freeze enemy AI every 4 seconds by pressing "E". But I never learned any programming languages except PASCAL 3.0 in school, so even if I was able to handle a syntax, script still don't work. I will be very thankful, if someone will show where I made mistake.
Here is that script:
--Freezing by pressing key E
function freeze_init(e)
end
function freeze_main(e)
StartTimer(e)
timer = GetTimer(e)
if g_KeyPressE == 1 and timer > 4000 then
StartTimer(e)
FreezeAI()
end
if timer == 4000 then
UnFreezeAi()
end
end