Advertisement
yeeeeeeeeeeeee

WEEEEEEEEEEEE

Mar 28th, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. -- player_info.lua
  2. local monitor = peripheral.wrap("top")
  3. local locator = peripheral.wrap("right")
  4.  
  5. if not monitor or not locator then
  6. print("Monitor or Player Locator not found!")
  7. return
  8. end
  9.  
  10. local args = { ... }
  11. if #args < 1 then
  12. print("Usage: player_info.lua <player_name>")
  13. return
  14. end
  15.  
  16. local playerName = args[1]
  17. monitor.setTextScale(1)
  18. monitor.clear()
  19. monitor.setCursorPos(2, 2)
  20. monitor.write("Player: " .. playerName)
  21.  
  22. local playerData = locator.getPlayerData(playerName)
  23. if playerData then
  24. monitor.setCursorPos(2, 4)
  25. monitor.write("X: " .. math.floor(playerData.x))
  26. monitor.setCursorPos(2, 5)
  27. monitor.write("Y: " .. math.floor(playerData.y))
  28. monitor.setCursorPos(2, 6)
  29. monitor.write("Z: " .. math.floor(playerData.z))
  30. end
  31.  
  32. monitor.setCursorPos(2, 8)
  33. monitor.write("[ Back ]")
  34.  
  35. while true do
  36. local event, side, x, y = os.pullEvent("monitor_touch")
  37. if y == 8 then
  38. shell.run("startup.lua")
  39. end
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement