How to get entity from server side

Hi, I wonder how can I take an entity that was created on the client side.

I’m using the NetworkGetEntityFromNetworkId()
option but it doesn’t return anything anyone knows the solution?

CLIENT

	peds = CreatePed(1, ped_hash, coords.x+3, coords.y, coords.z-0.5, 0, true, true)
 	netID = PedToNet(peds)
	SetNetworkIdCanMigrate(netID, true)
	
	Citizen.Wait(3000)
	TriggerServerEvent('test', netID)

SERVER

RegisterServerEvent('test')
AddEventHandler('test', function(id)        
       ped = NetworkGetEntityFromNetworkId(id)
       print(ped)
       print(DoesEntityExist(ped))

       DeleteEntity(ped)
end)

But the console returns that the ped has not been downloaded and does not exist

On the client you need to wait until the ped exists before you can get it’s network id.

The networkid is created normally and forwarded to the server side

but I cannot convert it into an entity

Just active oneSync :wink:

And don’t forget

local pedhash = GetHashKey("a_f_y_hipster_02")
        RequestModel(pedhash)
        while not HasModelLoaded(pedhash) do
            RequestModel(pedhash)
            Citizen.Wait(0)
        end

thanks onesync helped