Last active
January 27, 2017 17:14
-
-
Save KungRaseri/1c4cb9956196c2994345fbc8f6136e81 to your computer and use it in GitHub Desktop.
Avorion server command lua script
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
--- Place this file in the scripts/commands folder | |
package.path = package.path .. ";data/scripts/lib/?.lua" | |
function execute(sender, commandName, ...) | |
local args = {...} | |
local x = tonumber(args[1]) | |
local y = tonumber(args[2]) | |
if x ~= nil and y ~= nil then | |
if x > 500 or x < -500 or y > 500 or y < -500 then | |
Server():broadcastChatMessage("", 2, "The coordinate values must be between -500 and 500") | |
return 0, "", "" | |
end | |
Server():broadcastChatMessage("", 0, string.format("Home sector set to coordinates: (%s, %s)", x, y)) | |
Player():setHomeSectorCoordinates(x, y) | |
return 0, "", "" | |
end | |
Server():broadcastChatMessage("", 2, "The coordinate values provided are invalid") | |
return 0, "", "" | |
end | |
function getDescription() | |
return "Set your home sector to a specific sector" | |
end | |
function getHelp() | |
return "Set your home sector to the sector given. Restrictions: x and y values must be between -500 and 500. Usage: /setHomeSector -10 -234" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment