Scripts / Help with script

Author
Message
NikkoSin
8
Years of Service
User Offline
Joined: 10th May 2015
Location:
Posted: 13th May 2015 23:20
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
PM
J_C
16
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 14th May 2015 13:41
Hi NikkoSin I hope this is of help to you...



PM
NikkoSin
8
Years of Service
User Offline
Joined: 10th May 2015
Location:
Posted: 14th May 2015 20:16
Thank you very much!
PM

Login to post a reply

Server time is: 2024-05-07 10:14:18
Your offset time is: 2024-05-07 10:14:18