Skip to content

Instantly share code, notes, and snippets.

@Brianetta
Created February 15, 2012 21:31
Show Gist options
  • Save Brianetta/1839118 to your computer and use it in GitHub Desktop.
Save Brianetta/1839118 to your computer and use it in GitHub Desktop.
Target function
target = function (label)
if not label then return end
local target = (Space.GetBodies(function (body) return body.label == label end))[1]
if not target then return end
if target:isa('Ship') then
if not target:IsPlayer() then
Game.player:SetCombatTarget(target)
end
else
Game.player:SetNavTarget(target)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment