Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] oh so you can nest functions?

[DiscordArchive] oh so you can nest functions?

[DiscordArchive] oh so you can nest functions?

Pages (3): Previous 1 2 3 Next
rektbyfaith
Administrator
0
11-04-2022, 05:33 PM
#11
Archived author: Honey • Posted: 2022-11-04T17:33:13.477000+00:00
Original source

This uses the unique low guid of a player as a key and assigns the X coordinate as a value.
rektbyfaith
11-04-2022, 05:33 PM #11

Archived author: Honey • Posted: 2022-11-04T17:33:13.477000+00:00
Original source

This uses the unique low guid of a player as a key and assigns the X coordinate as a value.

rektbyfaith
Administrator
0
11-04-2022, 05:35 PM
#12
Archived author: jintao41 • Posted: 2022-11-04T17:35:06.028000+00:00
Original source

and any player could even be the same player so it stores new coordinates
rektbyfaith
11-04-2022, 05:35 PM #12

Archived author: jintao41 • Posted: 2022-11-04T17:35:06.028000+00:00
Original source

and any player could even be the same player so it stores new coordinates

rektbyfaith
Administrator
0
11-04-2022, 05:35 PM
#13
Archived author: jintao41 • Posted: 2022-11-04T17:35:17.596000+00:00
Original source

I understand, thank you again
rektbyfaith
11-04-2022, 05:35 PM #13

Archived author: jintao41 • Posted: 2022-11-04T17:35:17.596000+00:00
Original source

I understand, thank you again

rektbyfaith
Administrator
0
11-04-2022, 05:36 PM
#14
Archived author: Honey • Posted: 2022-11-04T17:36:14.871000+00:00
Original source

Right
rektbyfaith
11-04-2022, 05:36 PM #14

Archived author: Honey • Posted: 2022-11-04T17:36:14.871000+00:00
Original source

Right

rektbyfaith
Administrator
0
11-04-2022, 05:36 PM
#15
Archived author: Honey • Posted: 2022-11-04T17:36:29.752000+00:00
Original source


[Image: image0.gif?ex=690c33dd&is=690ae25d&hm=dc...521160b0a&]
rektbyfaith
11-04-2022, 05:36 PM #15

Archived author: Honey • Posted: 2022-11-04T17:36:29.752000+00:00
Original source


[Image: image0.gif?ex=690c33dd&is=690ae25d&hm=dc...521160b0a&]

rektbyfaith
Administrator
0
11-04-2022, 10:02 PM
#16
Archived author: iThorgrim • Posted: 2022-11-04T22:02:09.873000+00:00
Original source

M, X, Z, O, Y are not global is local to block SwitchZone
rektbyfaith
11-04-2022, 10:02 PM #16

Archived author: iThorgrim • Posted: 2022-11-04T22:02:09.873000+00:00
Original source

M, X, Z, O, Y are not global is local to block SwitchZone

rektbyfaith
Administrator
0
11-04-2022, 10:04 PM
#17
Archived author: iThorgrim • Posted: 2022-11-04T22:04:47.428000+00:00
Original source

U Can use
```
player:SetData("pos_x", player:GetX())

player:GetData("pos_x")
```
rektbyfaith
11-04-2022, 10:04 PM #17

Archived author: iThorgrim • Posted: 2022-11-04T22:04:47.428000+00:00
Original source

U Can use
```
player:SetData("pos_x", player:GetX())

player:GetData("pos_x")
```

rektbyfaith
Administrator
0
11-04-2022, 10:07 PM
#18
Archived author: Foe • Posted: 2022-11-04T22:07:40.230000+00:00
Original source

If the code linked above is the full script, then those variables are indeed global
rektbyfaith
11-04-2022, 10:07 PM #18

Archived author: Foe • Posted: 2022-11-04T22:07:40.230000+00:00
Original source

If the code linked above is the full script, then those variables are indeed global

rektbyfaith
Administrator
0
11-04-2022, 10:09 PM
#19
Archived author: Foe • Posted: 2022-11-04T22:09:44.194000+00:00
Original source

Declaration within the function SwitchZone without local doesn't inherently make them local to the script scope
rektbyfaith
11-04-2022, 10:09 PM #19

Archived author: Foe • Posted: 2022-11-04T22:09:44.194000+00:00
Original source

Declaration within the function SwitchZone without local doesn't inherently make them local to the script scope

rektbyfaith
Administrator
0
11-04-2022, 10:18 PM
#20
Archived author: Foe • Posted: 2022-11-04T22:18:58.705000+00:00
Original source

```Lua
local function SwitchZone(event, player)
local t = {}
t.map = player:GetMapId()
t.x, t.y, t.z, t.o = player:GetLocation()
player:SetData("pos", t)
end

local function ReviveInDungeon(event, killer, killed)
local t = player:GetData("pos")
if(t) then
killed:Teleport(t.map, t.x, t.y, t.z, t.o)
killed:ResurrectPlayer(100)
killed:SendChatMessageToPlayer( 11, 0, "revived", killed )
end
end

RegisterPlayerEvent(27, SwitchZone)
RegisterPlayerEvent(8, ReviveInDungeon) -- PLAYER_EVENT_ON_KILLED_BY_CREATURE = 8, // (event, killer, killed)```
rektbyfaith
11-04-2022, 10:18 PM #20

Archived author: Foe • Posted: 2022-11-04T22:18:58.705000+00:00
Original source

```Lua
local function SwitchZone(event, player)
local t = {}
t.map = player:GetMapId()
t.x, t.y, t.z, t.o = player:GetLocation()
player:SetData("pos", t)
end

local function ReviveInDungeon(event, killer, killed)
local t = player:GetData("pos")
if(t) then
killed:Teleport(t.map, t.x, t.y, t.z, t.o)
killed:ResurrectPlayer(100)
killed:SendChatMessageToPlayer( 11, 0, "revived", killed )
end
end

RegisterPlayerEvent(27, SwitchZone)
RegisterPlayerEvent(8, ReviveInDungeon) -- PLAYER_EVENT_ON_KILLED_BY_CREATURE = 8, // (event, killer, killed)```

Pages (3): Previous 1 2 3 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)