Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] What do you need it for?

[DiscordArchive] What do you need it for?

[DiscordArchive] What do you need it for?

rektbyfaith
Administrator
0
03-06-2024, 12:39 AM
#1
Archived author: Foe • Posted: 2024-03-06T00:39:19.251000+00:00
Original source

What do you need it for?
rektbyfaith
03-06-2024, 12:39 AM #1

Archived author: Foe • Posted: 2024-03-06T00:39:19.251000+00:00
Original source

What do you need it for?

rektbyfaith
Administrator
0
03-06-2024, 12:49 AM
#2
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) ```
rektbyfaith
03-06-2024, 12:49 AM #2

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

rektbyfaith
Administrator
0
03-06-2024, 12:50 AM
#3
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
rektbyfaith
03-06-2024, 12:50 AM #3

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

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)