Advertisement
DOGGYWOOF

Untitled

Oct 22nd, 2024 (edited)
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. -- Ask which side to open the door
  2. print("Which side do you want to open the door? (left, right, front, back, top, bottom)")
  3. local side = read()
  4.  
  5. -- Ensure the input is valid
  6. local validSides = {left = true, right = true, front = true, back = true, top = true, bottom = true}
  7.  
  8. if validSides[side] then
  9. -- Activate redstone on the chosen side
  10. redstone.setOutput(side, true)
  11. print("Door on the " .. side .. " is open!")
  12.  
  13. -- Wait a bit before closing the door
  14. sleep(3)
  15.  
  16. -- Turn off redstone signal to close the door
  17. redstone.setOutput(side, false)
  18. print("Door on the " .. side .. " is closed!")
  19. else
  20. print("Invalid side entered. Please choose a valid side.")
  21. end
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement