dcchill

Untitled

Apr 21st, 2023 (edited)
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. monitor = peripheral.wrap("top")
  2. pd = peripheral.find("playerDetector")
  3.  
  4. -- Ask the user to enter a player's name
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. write("Enter a player's name: ")
  8. local playerName = read()
  9.  
  10. -- Get the player's position from the player detector
  11. local data = pd.getPlayerPos(playerName)
  12.  
  13. -- Display the player's position on the monitor
  14. if data then
  15. monitor.write(playerName .. " in " .. data["dimension"] .. " at " .. data["x"] .. " " .. data["y"] .. " " .. data["z"])
  16. else
  17. monitor.write(playerName .. " not found")
  18. end
  19.  
Advertisement
Add Comment
Please, Sign In to add comment