Advertisement
Guest User

switch

a guest
Dec 13th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. switch = true
  2. mon = peripheral.wrap("monitor_0")
  3. while true do
  4.   local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  5.    if switch == true then
  6.      switch = false
  7.      redstone.setOutput("back",false)
  8.      sleep(0.5)
  9.    elseif switch == false then
  10.      switch = true
  11.      redstone.setOutput("back",true)
  12.      sleep(0.5)
  13.    end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement