Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local players = {Ranubis,Fishmastr}
- local range = 3
- local redstone = component.redstone
- local sides = require("sides")
- while true do
- local _,_,x,y,z,entity = event.pull("motion")
- if math.abs(x)<= tonumber(range) and math.abs(y)<= tonumber(range) and math.abs(z)<= tonumber(range) then
- if entity == players[name] then
- print("Welcome back "..entity..".")
- redstone.setOutput(sides.top,15)
- os.sleep(2)
- redstone.setOutput(sides.top,0)
- os.sleep(2)
- end
- else
- print("Hello "..entity..". Sorry, but you are not allowed to enter.")
- os.sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement