• 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 What comand i should use for wait?

Gothric

New Member
Joined
Feb 6, 2010
Messages
264
Reaction score
1
I am writing script on stepin
and i want to doteleportthing but after sometime for example 10 sec

;] do you understand? i stepin i wait 10 seconds and i get tp

but what i should write?
 
Actually, the TFS has a function Sleep() something like that, but its not working ;E (( Last time I checked was v0.3.6pl1 ))

I was searching for something like this time before, and the only function I got, had the problem that, when executed, it sleeps the whole server. So, if you Sleep the script 5 sec, the whole server will froze for 5 seconds u_u Too bad.

Btw. You can use addEvent function. Here an example:

Code:
function onStepIn(cid, item, pos)
local time = 10   -- 10 seconds

if getPlayerLevel(cid) > 100 then
addEvent(doMakeTeleport, time*1000, {cid = cid})
end
end

function doMakeTeleport(parameters)
cid = parameters.cid
	doTeleportThing(cid, {x=1000,y=1000,z=7})
end
 
Back
Top