Advertisement
mralasic

parkout-finished

May 14th, 2022
695
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #the current spot of respawning the player which will change depending on the checkpoint
  2. currentRespawnPosition=player.position()
  3. #this varialbe will make sure that the stage is only created once during the gameplay
  4. isStage1=False
  5. isStage2=False
  6. isStage3=False
  7. isStage4=False
  8.  
  9. def death():
  10.     player.teleport(currentRespawnPosition)
  11. player.on_died(death)
  12.  
  13. #building the stairs and the platform loading stage 1
  14. def newParkour():
  15.     #teleporting the builder close to the player
  16.     builder.teleport_to(pos(5, 0, 0))
  17.     #rotate it
  18.     builder.face(EAST)
  19.     for i in range(70):
  20.         #the builder places a stairs block
  21.         builder.place(PURPUR_STAIRS)
  22.         #the builder moves up and forward
  23.         builder.shift(1, 1, 0)
  24.     #marking the current position of the builder
  25.     builder.mark()
  26.     #moving the builder
  27.     builder.shift(2, 0, -4)
  28.     #the builder fills the space between its position and the mark with blocks
  29.     builder.fill(DIAMOND_BLOCK)
  30.  
  31. player.on_chat("start", newParkour)
  32.  
  33. def stage1and2(builderRotation,courseType,checkpointType):
  34.     #teleporting the builder under the platform and shifting it
  35.     builder.teleport_to(pos(1, -4, 0))
  36.     builder.mark()
  37.     builder.face(EAST)
  38.     for i in range(2):
  39.         for j in range(5):
  40.             #moving the builder
  41.             builder.move(FORWARD, randint(3, 8))
  42.             #creating a line of the certain block
  43.             builder.line(courseType)
  44.             #moving the builder to create a space between blocks
  45.             builder.move(FORWARD, randint(2, 4))
  46.             #marking the position so the next line is built starting from it
  47.             builder.mark()
  48.             #turning the builder
  49.         builder.turn(builderRotation)
  50.     #creating a new platform
  51.     builder.mark()
  52.     builder.shift(2, 0, -4)
  53.     builder.fill(checkpointType)
  54.  
  55. def stage3():
  56.     #creating a sphere made of slime blocks
  57.     shapes.sphere(SLIME_BLOCK, pos(4, -30, 0), 1, ShapeOperation.REPLACE)
  58.     builder.teleport_to(pos(6, -32, 0))
  59.     builder.mark()
  60.     builder.face(EAST)
  61.     #setting the starting position and we will return here with the constructor and add some fire
  62.     builder.set_origin()
  63.     builder.move(FORWARD, 65)
  64.     builder.line(NETHERRACK)
  65.     #going back to add fire
  66.     builder.teleport_to_origin()
  67.     builder.move(UP, 1)
  68.     for i in range(11):
  69.         builder.move(FORWARD, randint(3, 8))
  70.         builder.place(FIRE)
  71.     #building a platform
  72.     builder.mark()
  73.     builder.shift(2, 0, -4)
  74.     builder.fill(MOSS_STONE)
  75.  
  76. def stage4():
  77.     #making the leap of faith
  78.     builder.move(DOWN, 30)
  79.     builder.face(SOUTH)
  80.     builder.move(FORWARD, 6)
  81.     #building a well with water
  82.     builder.mark()
  83.     builder.shift(2, 2, 2)
  84.     builder.fill(BRICKS)
  85.     builder.shift(-1, 0, -1)
  86.     builder.place(WATER)
  87.     builder.move(FORWARD, 4)
  88.     builder.set_origin()
  89.     #the loop creating the spiral stairs ends when the player stands on the last platform
  90.     while not (blocks.test_for_block(SEA_LANTERN, pos(0, -1, 0))):
  91.         builder.teleport_to_origin()
  92.         builder.face(SOUTH)
  93.         #the building of the stairs can be stopped when the player stands on the last platform
  94.         for i in range(30):
  95.             if not blocks.test_for_block(SEA_LANTERN, pos(0, -1, 0)):
  96.                 builder.place(POLISHED_GRANITE)
  97.                 builder.move(FORWARD, 1)
  98.                 builder.move(UP, 1)
  99.                 builder.turn(RIGHT_TURN)
  100.             else:
  101.                 break
  102.         builder.mark()
  103.         builder.shift(-2, 0, 2)
  104.         builder.fill(SEA_LANTERN)
  105.         builder.teleport_to_origin()
  106.         builder.face(SOUTH)
  107.         #replacing stairs for magma blocks
  108.         for i in range(30):
  109.             if not blocks.test_for_block(SEA_LANTERN, pos(0, -1, 0)):
  110.                 builder.place(MAGMA_BLOCK)
  111.                 builder.move(FORWARD, 1)
  112.                 builder.move(UP, 1)
  113.                 builder.turn(RIGHT_TURN)
  114.                 loops.pause(1000)
  115.             else:
  116.                 break
  117.     #the player gets a bucket of water and does water bucket challenge, drops in the abyss and clicks RMB to pour water underneath themselves to absorb the fall
  118.     player.execute("/clear")
  119.     mobs.give(mobs.target(NEAREST_PLAYER), WATER_BUCKET, 5)
  120.  
  121. #the loop controlling loading stages and checkpoint system
  122. while True:
  123.     if blocks.test_for_block(DIAMOND_BLOCK, pos(0, -1, 0)) and not isStage1:
  124.         #updating player's position
  125.         currentRespawnPosition = player.position()
  126.         isStage1 = True
  127.         stage1and2(RIGHT_TURN,SLIME_BLOCK,GOLD_BLOCK)
  128.     elif blocks.test_for_block(GOLD_BLOCK, pos(0, -1, 0)) and not isStage2:
  129.         currentRespawnPosition = player.position()
  130.         isStage2 = True
  131.         stage1and2(LEFT_TURN,MAGENTA_STAINED_GLASS_PANE,BEDROCK)
  132.     elif blocks.test_for_block(BEDROCK, pos(0, -1, 0)) and not isStage3:
  133.         currentRespawnPosition = player.position()
  134.         isStage3 = True
  135.         stage3()
  136.     elif blocks.test_for_block(MOSS_STONE, pos(0, -1, 0)) and not isStage4:
  137.         currentRespawnPosition = player.position()
  138.         isStage4 = True
  139.         stage4()
  140.  
  141.  
  142.  
  143.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement