HumanTree92/VENT_ESX_Scripts

Fix for multiple car spawned if scroll too quickly

Closed this issue · 0 comments

In BuyVehicleShopMenu() look for this line, there will be 2

ESX.Game.SpawnLocalVehicle(vehicleData.model, thisShop.Inside, thisShop.InsideH, function(vehicle) currentDisplayVehicle = vehicle TaskWarpPedIntoVehicle(playerPed, vehicle, -1) FreezeEntityPosition(vehicle, true) SetModelAsNoLongerNeeded(vehicleData.model) end)

Add
while DoesEntityExist(currentDisplayVehicle) do DeleteEntity(currentDisplayVehicle) Wait(100) end

Above currentDisplayVehicle = vehicle