Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- motionSensor = component.motion_sensor
- colors = require("colors")
- sides = require("sides")
- event = require("event")
- redstone = component.redstone
- side = sides.
- signal = colors.red
- args = {...}
- whitelist = {"player","player","player"}
- function Check()
- end
- while true do
- local _,_,x,y,z,player = event.pull("motion")
- if args == "debug" then --text then
- print("x: "..x)
- print("y: "..y)
- print("z: "..z)
- print("player: ".. player)
- end
- Y = math.floor(y) -- the default over door is: -3
- if x > -5 and x < 5 and Y >= -3 then
- for k,v in pairs(whitelist) do
- if player == v then
- redstone.setBundledOutput(side,signal,15)
- os.sleep(2)
- redstone.setBundledOutput(side,signal,0)
- else
- redstone.setBundledOutput(side,signal,0)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement