This commit is contained in:
LordMZTE 2021-11-14 15:54:30 +01:00
parent 29d3da0737
commit a55e1d9b46

28
classic_tech/ar.lua Normal file
View file

@ -0,0 +1,28 @@
local ar = peripheral.find "arController"
local pl_detector = peripheral.find "playerDetector"
if ar == nil or pl_detector == nil then
error "couldnt find all peripherals. need ar controller and player detector"
end
while true do
local text = {}
text[1] = "Players:"
for _, p in pairs(pl_detector.getOnlinePlayers()) do
local pos = pl_detector.getPlayerPos(p)
if pos == nil then
table.insert(text, p .. " @ ?")
else
table.insert(text, p .. " @ X: " .. pos.x .. " Y: " .. pos.y .. " Z: " .. pos.z)
end
end
ar.clear()
for i, l in ipairs(text) do
ar.drawRightboundString(l, 10 * i - 1, 0, 0xffffff)
end
sleep(1)
end