Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap('left')
- local teleposer = peripheral.wrap('right')
- redstone.setOutput('right', false)
- whiteList =
- {
- --players
- 'DChacha777',
- 'TrayvonMartin2',
- 'GeorgeZimmerman7', -- potentially incorrect
- 'DerpyFoodz',
- --annoying ass admins
- 'lagon8',
- 'TheNetPlex',
- 'ashley1213',
- 'Setheren',
- 'Rhodderz',
- 'ABT11',
- 'UThicc',
- 'EnderDemon72',
- 'ItsHighNo0n',
- 'Newt02',
- 'AkameMashiru',
- }
- --Compare string to table using
- table.contains = function(self, element)
- for k,v in pairs(self) do
- if v == element then
- return true
- end
- end
- return false
- end
- --Main loop
- while true do
- playerTable = sensor.getPlayers()
- for i = 1,#playerTable do
- playerName = playerTable[i]["name"]
- if table.contains(whiteList, playerName)
- then
- else
- redstone.setOutput('right', true)
- sleep(1)
- teleposer.destroyStack(1)
- redstone.setOutput('right', false)
- os.reboot()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement