[DiscordArchive] What do you need it for?
[DiscordArchive] What do you need it for?
Archived author: Foe • Posted: 2024-03-06T00:39:19.251000+00:00
Original source
What do you need it for?
Archived author: Foe • Posted: 2024-03-06T00:49:55.121000+00:00
Original source
```Lua
local zoneId = 1 -- zone id to check for here
local updateTime = 10 -- time in seconds for the event to repeat
local function OnUpdateZone(event, player, newZone, newArea)
newZone = newZone or player:GetZoneId()
newArea = newArea or player:GetAreaId()
if(newZone == zoneId) then
-- do stuff
-- register a timed event that happens every x seconds
player:RegisterEvent(function() OnUpdateZone(nil, player) end, updateTime*1000, 1)
end
end
RegisterPlayerEvent(27, OnUpdateZone) ```
Archived author: Foe • Posted: 2024-03-06T00:50:22.752000+00:00
Original source
That does what you asked for, but I'm not sure if it's what you really need