Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensor = peripheral.wrap("left")
- gterm = peripheral.wrap("top")
- owner = SvechAS
- local pl_list = {}
- local pl_pos = {}
- gterm.clear()
- pl_box = gterm.addBox(5, 25, 100, 10, 0x000000, 0.4)
- gterm.addText(6, 26, "Players nearby:", 0xFFFFFF)
- gterm.addBox(5, 150, 100, 100, 0x339933, 0.2)
- for i = 0, 19 do
- pl_pos[i] = gterm.addBox(0, 0, 5, 5, 0xFFFFFF, 0.2)
- end
- while true do
- pl = sensor.getPlayerNames()
- pl_box.setHeight(10 + 10 * #pl)
- q = 0
- for i, j in pairs(pl) do
- data = sensor.getPlayerData(j)
- pos = data["position"]
- pl_pos[i].setX(pos["x"] + 55)
- pl_pos[i].setY(pos["z"] + 205)
- pl_list[i] = gterm.addText(6, 26 + 10 * i, j, 0xFFFFFF)
- end
- os.sleep(5)
- for i = 1, #pl do
- pl_list[i].delete()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement