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
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)