Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to open the door based on the given side
- local function openDoor(side)
- -- Check the side input and perform actions accordingly
- if side == "left" then
- redstone.setOutput("left", true) -- Replace "left" with the actual side where the door is connected
- sleep(2) -- Keep the door open for 2 seconds (you can adjust this as needed)
- redstone.setOutput("left", false) -- Replace "left" with the same side to close the door
- elseif side == "right" then
- redstone.setOutput("right", true) -- Replace "right" with the actual side where the door is connected
- sleep(2) -- Keep the door open for 2 seconds (you can adjust this as needed)
- redstone.setOutput("right", false) -- Replace "right" with the same side to close the door
- else
- print("Invalid side input. Please enter 'left' or 'right'.")
- end
- end
- -- Ask the user which side the door is on
- print("Which side is the door on? (left/right)")
- local sideInput = read() -- Read user input
- -- Open the door based on the given side input
- openDoor(sideInput)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement