Skip to content

Instantly share code, notes, and snippets.

@KungRaseri
Last active January 27, 2017 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KungRaseri/1c4cb9956196c2994345fbc8f6136e81 to your computer and use it in GitHub Desktop.
Save KungRaseri/1c4cb9956196c2994345fbc8f6136e81 to your computer and use it in GitHub Desktop.
Avorion server command lua script
--- 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