[DiscordArchive] how would i go about getting the map, if there is no player nearby?
[DiscordArchive] how would i go about getting the map, if there is no player nearby?
Archived author: Fero • Posted: 2021-09-09T18:41:05.896000+00:00
Original source
how would i go about getting the map, if there is no player nearby?
Archived author: Honey • Posted: 2021-09-09T18:42:18.730000+00:00
Original source
store the mapId in a variable when you spawn the creature
Archived author: Honey • Posted: 2021-09-09T18:42:26.404000+00:00
Original source
then call this later:
<https://elunaluaengine.github.io/Global/GetMapById.html>
Archived author: Fero • Posted: 2021-09-09T18:44:33.910000+00:00
Original source
```
local map = GetMapById(0)
mistake--local guid = map:GetWorldObject(500000):ToCreature()
local creature = map:GetWorldObject(guid):ToCreature()
```
so like this?
Archived author: Honey • Posted: 2021-09-09T18:46:02.626000+00:00
Original source
the second line isn't required
Archived author: Honey • Posted: 2021-09-09T18:46:17.218000+00:00
Original source
youw ant to store the guid of the creature in a variable when you spawn it
Archived author: Fero • Posted: 2021-09-09T18:46:49.509000+00:00
Original source
i've got the map and the guid stored
Archived author: Fero • Posted: 2021-09-09T18:47:11.026000+00:00
Original source
I'm still getting "attempt to index a nil value"
Archived author: Fero • Posted: 2021-09-09T18:48:50.835000+00:00
Original source
The issue is this line
```
local creature = map:GetWorldObject(500000):ToCreature()
```