SolvedHow to loop for GLua?
Thank you for the reply, and help. But lets say I don't want it do do 100 loops in a second is there away I can delay each loop?
- - - Updated - - -
Also what would I look up to understand these lines?
function stop(p,c,a)
for i = 1,tonumber(a[1])
- - - Updated - - -
Also what would I look up to understand these lines?
function stop(p,c,a)
for i = 1,tonumber(a[1])
Use a timer like this:
Code:
function stop(p,c,a)
local Time = 0
for i = 1,tonumber(a[1]) do
Time = Time + tonumber(a[2])
timer.Simple(tonumber(a[3]) + Time, function()
RunConsoleCommand("say","/drop" .. " ")
RunConsoleCommand("say","/sleep" .. " ")
end)
end
end
concommand.Add ("brk", stop)
10 = loop
2 = the pause between each timer
10 is the delay in seconds + Time
brk 10 2 10
So it'll be
10
12
14
16
18
brk 10 5 10
10
15
20
25
30
FYI if you're looking at this still, You could use timer.Create
But the way suchisgood is also very good to know when not working with stuff GLUA related.
But the way suchisgood is also very good to know when not working with stuff GLUA related.
This thread is closed for replies.
