Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("top")
- pd = peripheral.find("playerDetector")
- -- Ask the user to enter a player's name
- term.clear()
- term.setCursorPos(1,1)
- write("Enter a player's name: ")
- local playerName = read()
- -- Get the player's position from the player detector
- local data = pd.getPlayerPos(playerName)
- -- Display the player's position on the monitor
- if data then
- monitor.write(playerName .. " in " .. data["dimension"] .. " at " .. data["x"] .. " " .. data["y"] .. " " .. data["z"])
- else
- monitor.write(playerName .. " not found")
- end
Advertisement
Add Comment
Please, Sign In to add comment