Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_23")
- ps = peripheral.wrap("playerSensor_1")
- local player = "null"
- local range = 1
- function check()
- pstable = ps.getNearbyPlayers()
- mainps = pstable[1]
- player = mainps.player
- range = mainps.distance
- mon.clear()
- if range < 10 then
- mon.setCursorPos(1,1)
- mon.write("hello "..player)
- end
- sleep(1)
- end
- while true do
- check()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement