SetEntityAsMissionEntity not working?

local vehicle = CreateVehicle(model, coords.x,coords.y, carspawn,rand_real(0,360), true, true)
SetEntityAsMissionEntity(vehicle, true, true)
if IsEntityAMissionEntity(vehicle) == true then print(“True”) end

whats wrong with that im lost, nothing prints, it doesnt get set as Mission

IsEntityAMissionEntity doesn’t return true, it returns 1 instead. So presuming everything else with your code is ok you could just remove the “== true” part and do like this:

if IsEntityAMissionEntity(vehicle) then 

I hope this helps!