[Help] Can vehicles be created in serverside?

I have written this on the server side but no vehicle spawns:

function createcar ()
		Vehicle = "burrito"
		RequestModel(GetHashKey(Vehicle))
		while not HasModelLoaded(GetHashKey(Vehicle)) or not HasCollisionForModelLoaded(GetHashKey(Vehicle)) do
			Wait(1)
		end
		car = CreateVehicle(GetHashKey(Vehicle),1798.45275878906,3668.26928710938,35.2545356750488 , math.random(), true, true)

end

But if i write it in client side the car spawns

Citizen.CreateThread(function()
do
Vehicle = “burrito”
RequestModel(GetHashKey(Vehicle))
while not HasModelLoaded(GetHashKey(Vehicle)) or not HasCollisionForModelLoaded(GetHashKey(Vehicle)) do
Wait(1)
end
car = CreateVehicle(GetHashKey(Vehicle),1798.45275878906,3668.26928710938,35.2545356750488 , math.random(), true, true)
end
end)

Vehicles cant be created in server side?

You cannot make vehicles like this.

Nice bumping of a 4 year old thread :slight_smile:

especially with a reply that’s since entirely wrong lol