Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Ask which side to open the door
- print("Which side do you want to open the door? (left, right, front, back, top, bottom)")
- local side = read()
- -- Ensure the input is valid
- local validSides = {left = true, right = true, front = true, back = true, top = true, bottom = true}
- if validSides[side] then
- -- Activate redstone on the chosen side
- redstone.setOutput(side, true)
- print("Door on the " .. side .. " is open!")
- -- Wait a bit before closing the door
- sleep(3)
- -- Turn off redstone signal to close the door
- redstone.setOutput(side, false)
- print("Door on the " .. side .. " is closed!")
- else
- print("Invalid side entered. Please choose a valid side.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement