Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Move the player to the specified coordinates
- local args = {...}
- if args[3] == nil then
- print('Requires 3 args.')
- else
- local p = peripheral.wrap('left')
- local username = p.getPlayers(1)
- local cX,cY,cZ = p.playerCoords(username)
- cX = math.floor(cX)
- cY = math.floor(cY)
- cZ = math.floor(cZ)
- local x = tonumber(args[1])
- local y = tonumber(args[2])
- local z = tonumber(args[3])
- local nX = cX + x
- local nY = cY + y
- local nZ = cZ + z
- print("Current player position: "..cX..", "..cY..", "..cZ)
- print("New player position: "..nX..", "..nY..", "..nZ)
- p.setPlayerPos(username, nX,nY,nZ)
- end
Advertisement
Add Comment
Please, Sign In to add comment