Forums WoW Modding Support Archives Azerothcore Discord Archives [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?

[DiscordArchive] how would i go about getting the map, if there is no player nearby?

rektbyfaith
Administrator
0
09-09-2021, 06:41 PM
#1
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?
rektbyfaith
09-09-2021, 06:41 PM #1

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?

rektbyfaith
Administrator
0
09-09-2021, 06:42 PM
#2
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
rektbyfaith
09-09-2021, 06:42 PM #2

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

rektbyfaith
Administrator
0
09-09-2021, 06:42 PM
#3
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>
rektbyfaith
09-09-2021, 06:42 PM #3

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>

rektbyfaith
Administrator
0
09-09-2021, 06:44 PM
#4
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?
rektbyfaith
09-09-2021, 06:44 PM #4

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?

rektbyfaith
Administrator
0
09-09-2021, 06:46 PM
#5
Archived author: Honey • Posted: 2021-09-09T18:46:02.626000+00:00
Original source

the second line isn't required
rektbyfaith
09-09-2021, 06:46 PM #5

Archived author: Honey • Posted: 2021-09-09T18:46:02.626000+00:00
Original source

the second line isn't required

rektbyfaith
Administrator
0
09-09-2021, 06:46 PM
#6
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
rektbyfaith
09-09-2021, 06:46 PM #6

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

rektbyfaith
Administrator
0
09-09-2021, 06:46 PM
#7
Archived author: Fero • Posted: 2021-09-09T18:46:49.509000+00:00
Original source

i've got the map and the guid stored
rektbyfaith
09-09-2021, 06:46 PM #7

Archived author: Fero • Posted: 2021-09-09T18:46:49.509000+00:00
Original source

i've got the map and the guid stored

rektbyfaith
Administrator
0
09-09-2021, 06:47 PM
#8
Archived author: Fero • Posted: 2021-09-09T18:47:11.026000+00:00
Original source

I'm still getting "attempt to index a nil value"
rektbyfaith
09-09-2021, 06:47 PM #8

Archived author: Fero • Posted: 2021-09-09T18:47:11.026000+00:00
Original source

I'm still getting "attempt to index a nil value"

rektbyfaith
Administrator
0
09-09-2021, 06:48 PM
#9
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()
```
rektbyfaith
09-09-2021, 06:48 PM #9

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

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