[Help] Car spawns

I’m trying add car spawns to my custom spawnpoint, I added this line:

vehicle_generator “turismor” { -1198.39, -692.98, 39.52, heading = 39.88 }

When I first tried with more cars I got stuck on loading screen. If anyone knows how to fix this i’d like to know. It only seems to work with a small amount of cars. Besides that they only appear very rarely, and im trying to make sure the cars are always there

try to call REQUEST_MODEL(hash) before CREATE_VEHICLE
than Wait(10) or so, so your comp has time to get the model.
This worked for me to spawn a lot of cars at once.

RequestModel(hash)
while not HasModelLoaded(hash) do
    Wait(1)
end

This should guarantee the model has been loaded before spawning the vehicle.

Thanks both of you, where do I add the line? Do I need to make a serperate resource for spawning cars or add it to fivem-map-skater - map.lua? This it what I have right now: (+ more spawnpoints and vehicle_generator lines)

vehicle_generator “turismor” { -1198.39, -692.98, 39.52, heading = 39.88 }

spawnpoint ‘a_m_y_genstreet_01’ { x = -1230.54, y = -645.18, z = 40.36 }

Would it work to add it before each vehicle_generator line? Like this:

RequestModel(0x185484E1)
while not HasModelLoaded(0x185484E1) do
Wait(1)
end
vehicle_generator “turismor” { -1198.39, -692.98, 39.52, heading = 39.88 }

spawnpoint ‘a_m_y_genstreet_01’ { x = -1230.54, y = -645.18, z = 40.36 }

I will try it tonight

u need to add it, before the vehicle spawns

Here’s what I tried:

RequestModel(0x185484E1)
while not HasModelLoaded(0x185484E1) do
Wait(1)
end
vehicle_generator “turismor” { -1198.39, -692.98, 39.52, heading = 39.88 }
RequestModel(0xB6410173)
while not HasModelLoaded(0xB6410173) do
Wait(1)
end
vehicle_generator “dubsta3” { -1195.96, -690.48, 39.89, heading = 39.88 }
RequestModel(0xDAC67112)
while not HasModelLoaded(0xDAC67112) do
Wait(1)
end
vehicle_generator “jackal” { -1201.32, -695.11, 39.73, heading = 39.88 }
RequestModel(0x067BC037)
while not HasModelLoaded(0x067BC037) do
Wait(1)
end
vehicle_generator “coquette” { -1204.08, -697.17, 39.65, heading = 39.88 }

Still same problem; it loads the cars when joining for the first time, but after going away and getting back they dont respawn on the location. Did I do something wrong here?