mc_computer_progs/classic_tech/bigbrother.lua
2021-11-12 23:38:31 +01:00

18 lines
497 B
Lua

local pl_detector = peripheral.find "playerDetector"
local mon = peripheral.find "monitor"
if mon == nil or pl_detector == nil then
error "not all peripherals present! need monitor and player detector"
end
while true do
local players = pl_detector.getOnlinePlayers()
for i, p in ipairs(players) do
local pos = pl_detector.getPlayerPos(p)
mon.setCursorPos(1, i)
mon.write(p .. " @ X: " .. pos.x .. " Y: " .. pos.y .. " Z: " .. pos.z)
end
sleep(2)
end