• 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 stopEvent

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
I need to stop an event which is in another script.
How can I do that?
Got no time to think about any solution myself, sorry guys, I'm really busy.
Thanks in advanced!
 
Uhmmm you can do this:

script1:
Lua:
-- do lots of stuff here
local event = addEvent(--whatever you want to add in here)
setPlayerStorageValue(cid,storageid,event)
script2:
Lua:
--do stuff here
stopEvent(cid,getPlayerStorageValue(cid,storageid))
this is the way I do it, there might be a better way dunno
 
Lua:
local event = addEvent(func, time, params)
if something then
	stopEvent(event)
end
 
but what if 3 players do whatever fires the addevent just a second after the other then the global storage would store the event of the last player not all the players.
In some cases, you may only need a single event running.
 
Back
Top Bottom