hello guys i have a little question
let's say i created a ped and when i create the ped there will be a trigger
to create this ped to all players and with a timer to destroy this ped
so how to make it synced for the new players ?
like when i create the ped to all players at the server it works
but how to make it working even when a new player enters the server ? with the same timer count
i know that i can create a ped on server side, but i want to know how to make synced on client side
codes:
addCommandHandler ("ped",
function ()
local x, y, z = getElementPosition (localPlayer)
triggerServerEvent ("createPed", localPlayer, x, y, z)
end
)
addEvent ("pedCreated", true)
addEventHandler ("pedCreated", root,
function (x, y, z)
local ped = createPed (7, x, y, z)
setTimer (function (ped)
destroyElement (ped)
end, 5000, 1, ped)
end
)
addEvent ("createPed", true)
addEventHandler ("createPed", root,
function (x, y, z)
triggerClientEvent (root, "pedCreated", source, x, y, z)
end
)
and let's say that i killed the ped, and if the ped died it will be destroyed to all players
that can see the ped, but how about new players