Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- players = {}
- monitor = peripheral.wrap("top")
- sens = peripheral.wrap("left")
- p = peripheral.wrap("bottom")
- function getlocation(username)
- data = sens.getPlayerData(username)
- x = data.position.x + 916
- y = data.position.y + 71
- z = data.position.z + 1071
- return x,y,z
- end
- function getdirection(username)
- data = sens.getPlayerData(username)
- yaw = data.yaw
- if yaw<225 and yaw>130 then
- direction = "North"
- elseif yaw>223 and yaw<331 then
- direction = "East"
- elseif yaw>309 then
- direction = "South"
- elseif yaw<46 then
- direction = "South"
- elseif yaw>44 and yaw<132 then
- direction = "West"
- else
- direction = "N/A"
- end
- return direction
- end
- bacon = true
- while bacon == true do
- input = read()
- if input == "stop" then
- bacon = false
- else
- table.insert(players, input)
- end
- end
- while true do
- p.clear()
- mony = 1
- for k,v in pairs(players) do
- x, y, z = getlocation(v)
- x = math.floor(x)
- y = math.floor(y)
- z = math.floor(z)
- dir = getdirection(v)
- text = p.addText(1,mony,v.." Is located at ".."X: "..tostring(x).." Y: "..tostring(y).." Z: "..tostring(z).." and is facing "..dir,0xFFFFFF)
- text.setScale(0.5)
- mony = mony + 4
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement