-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Important! This global variable is required to tell helicopter.lua we are using the call -- mechanism g_callMechanismActive = true local triggered = {} local numHelis = 0 function helicopter_call_init(e) triggered[e] = false end local function CloserThan(x,z,dist) local dX, dZ = x - g_PlayerPosX, z - g_PlayerPosZ return (dX*dX + dZ*dZ) < (dist * dist) end function helicopter_call_main(e) if not triggered[e] then local Ent = g_Entity[e] if CallHelicopters ~= nil and CloserThan(Ent.x, Ent.z, 200) then numHelis = CallHelicopters(4, 'friendly', 400) numHelis = numHelis + CallHelicopters(1, 'neutral', 30) triggered[e] = true end end Prompt(numHelis) end