Created
February 15, 2012 21:31
-
-
Save Brianetta/1839118 to your computer and use it in GitHub Desktop.
Target function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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