[DiscordArchive] you know now what i want to do ?
[DiscordArchive] you know now what i want to do ?
Archived author: Intemporel • Posted: 2021-12-13T18:35:28.136000+00:00
Original source
you know now what i want to do ?
Archived author: Intemporel • Posted: 2021-12-13T18:35:40.396000+00:00
Original source
Archived author: tester • Posted: 2021-12-13T18:45:10.640000+00:00
Original source
you just have multiple functions not named the same
Archived author: tester • Posted: 2021-12-13T18:46:07.293000+00:00
Original source
onPingOne,onPingTwo,OnPing3,OnPing4
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
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
Archived author: tester • Posted: 2021-12-13T18:47:02.073000+00:00
Original source
OnPing
onPingEvent()
end
onPingEvent()
ping1()
ping2()
ping3()
end
Archived author: Intemporel • Posted: 2021-12-13T18:47:14.637000+00:00
Original source
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)
```
Archived author: Intemporel • Posted: 2021-12-13T18:48:15.877000+00:00
Original source
You make me smile <@!137621762870345728>