Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] you know now what i want to do ?

[DiscordArchive] you know now what i want to do ?

[DiscordArchive] you know now what i want to do ?

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
12-13-2021, 06:35 PM
#1
Archived author: Intemporel • Posted: 2021-12-13T18:35:28.136000+00:00
Original source

you know now what i want to do ?
rektbyfaith
12-13-2021, 06:35 PM #1

Archived author: Intemporel • Posted: 2021-12-13T18:35:28.136000+00:00
Original source

you know now what i want to do ?

rektbyfaith
Administrator
0
12-13-2021, 06:35 PM
#2
Archived author: Intemporel • Posted: 2021-12-13T18:35:40.396000+00:00
Original source

rektbyfaith
12-13-2021, 06:35 PM #2

Archived author: Intemporel • Posted: 2021-12-13T18:35:40.396000+00:00
Original source

rektbyfaith
Administrator
0
12-13-2021, 06:45 PM
#3
Archived author: tester • Posted: 2021-12-13T18:45:10.640000+00:00
Original source

you just have multiple functions not named the same
rektbyfaith
12-13-2021, 06:45 PM #3

Archived author: tester • Posted: 2021-12-13T18:45:10.640000+00:00
Original source

you just have multiple functions not named the same

rektbyfaith
Administrator
0
12-13-2021, 06:46 PM
#4
Archived author: tester • Posted: 2021-12-13T18:46:07.293000+00:00
Original source

onPingOne,onPingTwo,OnPing3,OnPing4
rektbyfaith
12-13-2021, 06:46 PM #4

Archived author: tester • Posted: 2021-12-13T18:46:07.293000+00:00
Original source

onPingOne,onPingTwo,OnPing3,OnPing4

rektbyfaith
Administrator
0
12-13-2021, 06:46 PM
#5
Archived author: Intemporel • Posted: 2021-12-13T18:46:25.539000+00:00
Original source

but i don't want to add x functions in the main `OnPing()`, i just want one
rektbyfaith
12-13-2021, 06:46 PM #5

Archived author: Intemporel • Posted: 2021-12-13T18:46:25.539000+00:00
Original source

but i don't want to add x functions in the main `OnPing()`, i just want one

rektbyfaith
Administrator
0
12-13-2021, 06:46 PM
#6
Archived author: tester • Posted: 2021-12-13T18:46:43.218000+00:00
Original source

ok fine, then make 1 function on onPing that calls all of the other functions
rektbyfaith
12-13-2021, 06:46 PM #6

Archived author: tester • Posted: 2021-12-13T18:46:43.218000+00:00
Original source

ok fine, then make 1 function on onPing that calls all of the other functions

rektbyfaith
Administrator
0
12-13-2021, 06:47 PM
#7
Archived author: tester • Posted: 2021-12-13T18:47:02.073000+00:00
Original source

OnPing
onPingEvent()
end

onPingEvent()
ping1()
ping2()
ping3()
end
rektbyfaith
12-13-2021, 06:47 PM #7

Archived author: tester • Posted: 2021-12-13T18:47:02.073000+00:00
Original source

OnPing
onPingEvent()
end

onPingEvent()
ping1()
ping2()
ping3()
end

rektbyfaith
Administrator
0
12-13-2021, 06:47 PM
#8
Archived author: Intemporel • Posted: 2021-12-13T18:47:14.637000+00:00
Original source

rektbyfaith
12-13-2021, 06:47 PM #8

Archived author: Intemporel • Posted: 2021-12-13T18:47:14.637000+00:00
Original source

rektbyfaith
Administrator
0
12-13-2021, 06:47 PM
#9
Archived author: stoneharry • Posted: 2021-12-13T18:47:19.682000+00:00
Original source

You are declaring the same function twice in the global namespace, they will overwrite each other.

Instead you can register the function, something like this:

`SomeName.ext`
```lua
local listeners = {}

function RegisterPingHook(func)
table.insert(listeners, func)
end

local function OnPing()
for _,v in pairs(listeners) do
v()
end
end

CreateLuaEvent(OnPing, 10*10000, 0)
```
`SomeName.lua`
```lua
function MyScriptOnPing1()
print("hello world")
end

RegisterPingHook(MyScriptOnPing1)
```
rektbyfaith
12-13-2021, 06:47 PM #9

Archived author: stoneharry • Posted: 2021-12-13T18:47:19.682000+00:00
Original source

You are declaring the same function twice in the global namespace, they will overwrite each other.

Instead you can register the function, something like this:

`SomeName.ext`
```lua
local listeners = {}

function RegisterPingHook(func)
table.insert(listeners, func)
end

local function OnPing()
for _,v in pairs(listeners) do
v()
end
end

CreateLuaEvent(OnPing, 10*10000, 0)
```
`SomeName.lua`
```lua
function MyScriptOnPing1()
print("hello world")
end

RegisterPingHook(MyScriptOnPing1)
```

rektbyfaith
Administrator
0
12-13-2021, 06:48 PM
#10
Archived author: Intemporel • Posted: 2021-12-13T18:48:15.877000+00:00
Original source

You make me smile <@!137621762870345728>
rektbyfaith
12-13-2021, 06:48 PM #10

Archived author: Intemporel • Posted: 2021-12-13T18:48:15.877000+00:00
Original source

You make me smile <@!137621762870345728>

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