I use
function car()
local x, y, z = 801.07495117188,-3011.3627929688,-39.411521911621
local myPed = GetPlayerPed(-1)
local player = PlayerId()
local vehicle = GetHashKey('adder')
RequestModel(vehicle)
while not HasModelLoaded(vehicle) do
Wait(1)
end
local spawned_car = CreateVehicle(vehicle, x, y, z, 78.53, true, false)
SetVehicleOnGroundProperly(spawned_car)
SetVehicleNumberPlateText(spawned_car, "TEST")
SetEntityAsMissionEntity(spawned_car, true, true )
SetVehicleHasBeenOwnedByPlayer(spawned_car, true)
FreezeEntityPosition(spawned_car, true)
SetVehicleDoorsLocked(spawned_car, 2)
local id = NetworkGetNetworkIdFromEntity(spawned_car)
SetNetworkIdCanMigrate(id, true)
end
What could be the problem?