Doesn’t seem to work…
Spawn:
local newPed = CreatePed(5, config.hash, config.spawnX, config.spawnY, config.spawnZ, config.spawnHeading, true, false)
SetEntityAsMissionEntity(newPed, true, true)
NetworkRegisterEntityAsNetworked(newPed)
local netID = PedToNet(newPed)
NetworkSetNetworkIdDynamic(netID), false)
SetNetworkIdCanMigrate(netID, true)
SetNetworkIdExistsOnAllMachines(netID, true)
Later check:
local exists = false
local ped = nil
if config.NetId ~= nil then
NetworkRequestControlOfNetworkId(config.NetId)
NetworkRequestControlOfEntity(NetToPed(config.NetId))
if NetworkDoesNetworkIdExist(config.NetId) or DoesEntityExist(NetToPed(config.NetId)) then
local EntityCheck = NetToPed(config.NetId)
if DoesEntityExist(EntityCheck) then
ped = EntityCheck
end
exists = true
else
print( "Couldn't find NETWORK ID: " .. config.NetId)
end
end