[DiscordArchive] Seems to work, it just return 0 if no pet ^^ But how would I then load the pet using the guid, any i
[DiscordArchive] Seems to work, it just return 0 if no pet ^^ But how would I then load the pet using the guid, any i
Archived author: Grandold • Posted: 2022-05-04T16:36:08.022000+00:00
Original source
Seems to work, it just return 0 if no pet ^^ But how would I then load the pet using the guid, any idea what function would do that?
Archived author: Honey • Posted: 2022-05-04T16:41:37.080000+00:00
Original source
Map:GetWorldObject(Guid)
=
Archived author: Grandold • Posted: 2022-05-04T16:41:54.111000+00:00
Original source
ahhh ty, would not have guessed its in map class
=
Archived author: Grandold • Posted: 2022-05-04T16:47:23.313000+00:00
Original source
```
local petGUID = player:GetPetGUID()
if petGUID ~= 0 then
local pet = Map:GetWorldObject(petGUID)
print(pet:GetLevel())
end
``` gives error:
```
calling 'GetWorldObject' on bad self (bad argument : Map expected, got table)
```
Archived author: Grandold • Posted: 2022-05-04T16:51:48.756000+00:00
Original source
Aa I probably need to use instance of the map, but how would i get that then lol?
Archived author: Honey • Posted: 2022-05-04T16:52:08.344000+00:00
Original source
You need to assign Map.
GetMapById() for example.
Archived author: Honey • Posted: 2022-05-04T16:52:38.655000+00:00
Original source
Or you Pass the map object to the function.
Archived author: Honey • Posted: 2022-05-04T16:53:10.925000+00:00
Original source
The customworldboss lua does this
Archived author: Grandold • Posted: 2022-05-04T16:53:20.169000+00:00
Original source
okay thanks, ill check that
Archived author: Grandold • Posted: 2022-05-04T16:55:51.165000+00:00
Original source
there the mapID is assigned in the config, but is it possible to get the "current" mapID where the player is atm? or how does that work hmmhmm