I need help with making a script.
Basically what i want the script to do is: Change the speedhack to 1.07 and then back to the normal value 1. Every 2 seconds. So 1.07 for 2 seconds then turn it back down to 1 for 2 seconds. Just to have that on a loop.
If anyone could help it would be greatly appreciated. Thanks for your time
{$lua}
if syntaxcheck then return end -- do nothing on save/edit
[ENABLE]
-- make a timer to run code several times
local t = createTimer()
t.Interval = 2000 -- runs every 2 seconds, 2000 milliseconds
-- set the function for it to run
t.OnTimer = function(timer)
local s = speedhack_getSpeed()
if s == 1 then s = 1.07 else s = 1 end
speedhack_setSpeed(s)
end
_G[memrec.Description .. '___' .. memrec.id] = t -- copy into the global table using the scripts name and id so it's unique
[DISABLE]
_G[memrec.Description .. '___' .. memrec.id].destroy() -- destroy the timer by referencing the global table, now it won't keep running
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum