Normally this combination should be working.
But there is one thing that is incorrect, and that is where the event is triggered.
Currently it should trigger for all players, but multiplied by the amount of players. Since there is no player target set to where the event is sending to.
triggerClientEvent("raceCevent", thePlayer)
My recommendations:
Serverside
triggerClientEvent(
thePlayer, -- send to this player
"raceCevent",
resourceRoot -- source is resourceRoot
)
Clientside
addEvent("raceCevent", true)
addEventHandler("raceCevent",
resourceRoot, -- activate the event based on the source resourceRoot
function ()
end, false) -- disable propagate for security reasons