this creates how ever many planes as their is players in the city
function createHeli()
local vehicle = GetHashKey('dodo')
local hPed = GetHashKey("s_m_y_pilot_01")
RequestModel(vehicle)
while not HasModelLoaded(vehicle) do
Wait(1)
end
RequestModel(GetHashKey("s_m_y_pilot_01"))
while not HasModelLoaded(GetHashKey("s_m_y_pilot_01")) do
Wait(1)
end
local cluttered = GetClosestVehicle(2340.255859375, 6687.5219726563, 516.81469726563, 25.0, 0, 16384)
local pos = GetEntityCoords(GetPlayerPed(-1), true)
if not DoesEntityExist(existingVeh) then
Citizen.Trace("Plane has spawned")
existingVeh = CreateVehicle(vehicle, 2340.255859375, 6687.5219726563, 516.81469726563, 73.0, true, false)
heliPilot = CreatePedInsideVehicle(existingVeh, 4, GetHashKey("s_m_y_pilot_01"), -1, 1, true)
wondering how I can just get it to spawn once and only one, I can’t figure it out