Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --basic player logging
- --variables
- local sensorPos = 'top'
- local sensor = 'null'
- local playerList = 'null'
- local prevList = playerList
- --Main program logic
- function Main()
- sensor = peripheral.wrap(sensorPos)
- playerData = sensor.getPlayerNames()
- prevList = playerList
- for _, name in pairs(playerData) do
- playerList = name , ":"
- end
- if(#playerData) then
- if(playerList != prevList) then
- print (playerList)
- end
- end
- end
- --initialise
- if(peripheral.isPresent(sensorPos)) then
- print('success!')
- while true do
- Main()
- sleep(1)
- end
- else
- print('Please place a sensor ontop')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement