Delete Ped Issue

I have an event that deletes a ped (or tries to). This event will also trigger the event on other clients to delete it too, just in case. I am testing this with a 2nd player in my server. This only seems to work if the 2nd player is near. However, for some reason, the code works when the 2nd player does it, when I am not near. Does anybody have any idea what is going wrong or if I am doing something wrong here?

This is what I have currently been trying… The event triggered on other clients is the same stuff.

SetEntityAsMissionEntity(thispedguy, true, true) --DeleteEntity(thispedguy) --Citizen.Wait(1000) Citizen.InvokeNative(0x9614299DCB53E54B , Citizen.PointerValueIntInitialized(thispedguy)) Citizen.InvokeNative(0xAE3CBE5BF394C9C9 , Citizen.PointerValueIntInitialized(thispedguy))

I don’t know if it could work but have you tried to use the Ped netId ?

I have never even been able to set it as a network entity. As far as I know, that is broken :cold_sweat:

Or does it work and I’m just terrible?

I seem to be having a similar issue with what I am trying to do which is a command that removes all empty/unused vehicles, the script is very similar to yours it seems. I even tried using a different method of ‘removing’ I just set the entity to no longer be needed using 0xB736A491E64A32CF then SetEntityCoords and had it moved far away from the players where I am guessing will despawn it as long as no one is near but the problem still happened if I was near the other player and all I have it do on server side is TriggerClientEvent after a message triggers it so I am not too sure what the problem could be right now myself.

I suppose as a sort of work around, I could just TP them far away in the ocean or something, like you mentioned. Didn’t even think of that :stuck_out_tongue: