ElunaLuaEngine / Eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io
GNU General Public License v3.0
377 stars 362 forks source link

CreateLuaEvent #481

Closed afdz1 closed 6 months ago

afdz1 commented 6 months ago

Is it possible to return and stop the indefinite loop for a CreateLuaEvent?

The way documentation reads, I believe if the eventid is returned, the loop is supposed to stop?

local function CheckPlayer(playerGuid, eventid) local player = GetPlayerByGUID(playerGuid) if player:IsInWorld() then player:SendBroadcastMessage("Player in world, ending loop") return eventid end end

eventid = CreateLuaEvent(function() CheckPlayer(playerguid eventid) end, 1000, 0)

Foereaper commented 6 months ago

https://elunaluaengine.github.io/Global/RemoveEventById.html