Helicopter License (Item) – A mount that allows the player to fly at high speed, bypass terrain, and optionally teleport to saved locations (like a personal chopper).
AddMount(750001, name = "Attack Helicopter", model = "model/helicopter.o3d", -- you need to create or rename a model speed = 50, -- base walk speed ~12, so 50 = very fast fly = true, canattack = false, -- no attacking while mounted cooldown = 300, -- seconds before remount effects = effect = "fly_smoke", attach = "engine" , effect = "rotor_blur", attach = "rotor" , sound = "heli_rotor.wav", fuelItem = 750002, -- optional fuel consumption check fuelInterval = 600, -- seconds per fuel unit onFuelEmpty = function(player) Dismount(player) Message(player, "Out of fuel! Helicopter lands.") end ) You need these client assets (or substitute existing ones):
local slot = Ask("Save to slot (1,2,3):", 3) if slot == 1 then SetPlayerVar("HELI_SAVE_1", locData) SetPlayerVar("HELI_NAME_1", map) elseif slot == 2 then SetPlayerVar("HELI_SAVE_2", locData) SetPlayerVar("HELI_NAME_2", map) elseif slot == 3 then SetPlayerVar("HELI_SAVE_3", locData) SetPlayerVar("HELI_NAME_3", map) end Say("Location saved to slot "..slot) end
function RepairHeli() SetPlayerVar("HELI_COOLDOWN", 0) Say("Helicopter repaired. Cooldown removed.") end
function TeleportTo(locData) local parts = Split(locData, ",") local map = parts[1] local x = tonumber(parts[2]) local y = tonumber(parts[3]) local z = tonumber(parts[4])
function SaveLocation() local x, y, z = GetPlayerPos() local map = GetMapName() local locData = string.format("%s,%d,%d,%d", map, x, y, z)
function HasFuel() return CountItem(750002) > 0 or GetPlayerVar("HELI_FUEL_TICK") == "1" end
function OnTimer(timerID) if timerID == "FuelExpire" then SetPlayerVar("HELI_FUEL_TICK", "0") Notice("Your helicopter fuel has run out. Land safely.") end end Add this to your resource/mount.lua or similar mount definition file.
if choice == 1 then TeleportMenu() elseif choice == 2 then SaveLocation() elseif choice == 3 then BuyFuel() elseif choice == 4 then RepairHeli() else Say("Fly safe, pilot!") end end
if choice == 1 and loc1 then TeleportTo(loc1) elseif choice == 2 and loc2 then TeleportTo(loc2) elseif choice == 3 and loc3 then TeleportTo(loc3) else Say("No location saved there!") end end