• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Loops

Sherice

Sky&Wind
Joined
Jan 20, 2012
Messages
183
Reaction score
7
Location
Sweden
Hay !

Simple question: How do I do a loop? e.g. you say "Hi" every... 5 sec? ;)



Thanks in advance!
 
The a() in the end is the point where you initially call the function once to start "looping".
If you want it all X seconds you can also use a globalevent with a 5000ms interval.
 
You will either put this in lib/function or in top of every script that will use this function
Lua:
local function a()
-- say hi
addEvent(a, 5000)
end

and simply call this function in scripts by adding
Lua:
 a()
in your script
 
Back
Top Bottom