Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Check if the redstone signal is present on the left side of the computer
- local side = "left"
- -- Function to check door status
- local function checkDoor()
- if redstone.getInput(side) then
- print("The door is open.")
- else
- print("The door is closed.")
- end
- end
- -- Main loop to continuously check the door status
- while true do
- checkDoor()
- sleep(1) -- Wait for 1 second before checking again
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement