Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to build stairs by breaking blocks
- function buildStairs(stairSize)
- -- Loop through the stair size and break the blocks for the stairs
- for i = 1, stairSize do
- -- Break the block in front of the turtle
- turtle.dig() -- Break the block in front of the turtle
- -- Move forward to create the next step
- turtle.forward()
- turtle.digUp()
- -- Break the block below the turtle (creating a descending stair)
- turtle.digDown() -- Break the block below the turtle
- -- Move down a block to continue the stair effect
- turtle.down()
- end
- end
- -- Ask user for stair size (how long the stairs will be)
- print("Enter the stair size (number of steps):")
- local stairSize = tonumber(read())
- -- Build the stairs by breaking blocks with the specified size
- buildStairs(stairSize)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement