[DiscordArchive] Is there a way to access the world object from within a WorldObject:RegisterEvent() event? Like a "s
[DiscordArchive] Is there a way to access the world object from within a WorldObject:RegisterEvent() event? Like a "s
Archived author: ritzmenardi • Posted: 2023-06-21T02:47:43.869000+00:00
Original source
Is there a way to access the world object from within a WorldObject:RegisterEvent() event? Like a "self" variable or something?
Archived author: 0xCiBeR • Posted: 2023-06-21T03:57:15.423000+00:00
Original source
The last argument passed to the function is the worldobject
Archived author: 0xCiBeR • Posted: 2023-06-21T03:58:35.444000+00:00
Original source
(eventid, delay, repeats, worldobject)
Archived author: 0xCiBeR • Posted: 2023-06-21T03:58:47.250000+00:00
Original source
The example script here showcases it https://www.azerothcore.org/pages/eluna/...Event.html
[Embed: WorldObject:RegisterEvent - Eluna]
API documentation for the WorldObject:RegisterEvent method in the Eluna engine.
https://www.azerothcore.org/pages/eluna/...Event.html
Archived author: ritzmenardi • Posted: 2023-06-21T03:58:51.648000+00:00
Original source
Oh duh. I was looking at "synopsis" here:
https://www.azerothcore.org/pages/eluna/...Event.html
I should have looked at the example:
```lua
local function Timed(eventid, delay, repeats, worldobject)
print(worldobject:GetName())
end
worldobject:RegisterEvent(Timed, 1000, 5) -- do it after 1 second 5 times
worldobject:RegisterEvent(Timed, {1000, 10000}, 0) -- do it after 1 to 10 seconds forever
```
Archived author: ritzmenardi • Posted: 2023-06-21T03:59:07.547000+00:00
Original source
Thank you ❤️