Hello, since yesterday I found out something
The following resource will not trigger any client unless we use a Citizen.Wait(50) or more before triggering the client.
This will not work
Server:
Citizen.CreateThread(function()
TriggerClientEvent("test:me", -1)
end)
Client:
-- This is never triggered
RegisterNetEvent("test:me")
AddEventHandler("test:me", function()
print("a")
end)
This will work
Server:
Citizen.CreateThread(function()
Citizen.Wait(100)
TriggerClientEvent("test:me", -1)
end)
Client:
RegisterNetEvent("test:me")
AddEventHandler("test:me", function()
print("a")
end)
This issue was not happening till the last few days, and I found no reason for it to begin, I’m using recommended artifacts and a clear server to test it.
Just to be clear, a resource starting without a wait in it’s thread will not call any client function.