Advertisement
mralasic

#the current spot of respawning the player which will change depending on the checkpoint currparkour

May 14th, 2022 (edited)
822
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 starting construction
  62.     builder.set_origin()
  63.     builder.move(FORWARD, 65)
  64.     builder.line(NETHERRACK)
  65.     builder.teleport_to_origin()
  66.     builder.move(UP, 1)
  67.     for i in range(11):
  68.         builder.move(FORWARD, randint(3,8))
  69.         builder.place(FIRE)
  70.     #creating a new platform
  71.     builder.mark()
  72.     builder.shift(2, 0, -4)
  73.     builder.fill(MOSS_STONE)
  74.  
  75. def stage4():
  76.     #making the leap of faith
  77.     builder.move(DOWN, 30)
  78.     builder.face(SOUTH)
  79.     builder.move(FORWARD,6)
  80.     #building a well with water
  81.     builder.mark()
  82.     builder.shift(2, 2, 2)
  83.     builder.fill(BRICKS)
  84.     #moving the builder to center of bricks
  85.     builder.shift(-1, 0, -1)
  86.     builder.place(WATER)
  87.     #moving the builder outside of well
  88.     builder.move(FORWARD, 4)
  89.     builder.set_origin()
  90.     #loop creating the spiral stairs ends when player stands on the last platform
  91.     while not(blocks.test_for_block(SEA_LANTERN, pos(0, -1, 0))):
  92.         builder.teleport_to_origin()
  93.         builder.face(SOUTH)
  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.         for i in range(30):
  108.             if not(blocks.test_for_block(SEA_LANTERN, pos(0, -1, 0))):
  109.                 builder.place(MAGMA_BLOCK)
  110.                 builder.move(FORWARD,1)
  111.                 builder.move(UP, 1)
  112.                 builder.turn(RIGHT_TURN)
  113.                 loops.pause(1000)
  114.             else:
  115.                 break
  116.     player.execute("/clear")
  117.     mobs.give(mobs.target(NEAREST_PLAYER), WATER_BUCKET, 5)
  118.  
  119. #the loop controlling loading stages and checkpoint system
  120. while True:
  121.     if blocks.test_for_block(DIAMOND_BLOCK, pos(0, -1, 0)) and not isStage1:
  122.         #updating player's position
  123.         currentRespawnPosition = player.position()
  124.         isStage1 = True
  125.         stage1and2(RIGHT_TURN,SLIME_BLOCK,GOLD_BLOCK)
  126.     elif blocks.test_for_block(GOLD_BLOCK, pos(0, -1, 0)) and not isStage2:
  127.         currentRespawnPosition = player.position()
  128.         isStage2 = True
  129.         stage1and2(LEFT_TURN,MAGENTA_STAINED_GLASS_PANE,BEDROCK)
  130.     elif blocks.test_for_block(BEDROCK, pos(0, -1, 0)) and not isStage3:
  131.         currentRespawnPosition = player.position()
  132.         isStage3 = True
  133.         stage3()
  134.     elif blocks.test_for_block(MOSS_STONE, pos(0, -1, 0)) and not isStage4:
  135.         currentRespawnPosition = player.position()
  136.         isStage4 = True
  137.         stage4()
  138.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement