NickSProud

set_location.lua

Jun 26th, 2022 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. nsp = require("nsp_core")
  2. local args = { ... }
  3. local location = {["x"] = 0,["z"] = 0,["y"] = 0,["f"] = "N", ["name"] = "name not set"}
  4. if #args == 4 then
  5.     nsp_core.set_location(args[1],args[2],args[3],args[4])
  6. elseif #args ==  5 then
  7.     nsp_core.set_location(args[1],args[2],args[3],args[4],args[5])
  8. elseif #args == 1 then
  9.     location = nsp_core.unserialize("turtle_location")
  10.     if location == nil then
  11.         print("error, no turtle location to set")
  12.     else
  13.         nsp_core.set_location(args[1],location["x"],location["z"],location["y"],location["f"])
  14.     end
  15. end
Add Comment
Please, Sign In to add comment