1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple Elevator

Discussion in 'Requests' started by FistoF, Feb 4, 2020.

  1. FistoF

    FistoF Active Member

    Joined:
    Feb 11, 2017
    Messages:
    53
    Likes Received:
    0
    Category:
    Mechanics

    Suggested name:
    Simple Elevator

    Server version:
    1.15

    What I want:
    A possibility to create an elevator by placing a block (defined in the configs) on each floor in a vertical line. Jump on the block to go a higher level, crouch to go to a lower level.

    Configuration:
    minElevation: 2 #The minimum distance to place valid elevator blocks
    maxElevation: 64 #The maximum distance
    elevatorWhoosh: entity_iron_golem_attack #The sound played when a player uses an elevator.
    elevatorMaterial: emerald block #The block type used for elevators.
    useUpDownMessages: false #Display a message when teleporting up and down?
    up: "&aYou have ascended a level."
    down: "&cYou have descended a level."
    noPermission : "&cYou do not have permission to do this."

    Permission:
    simpleelevator.use
     
  2. Conutik

    Conutik Member

    Joined:
    Jan 12, 2020
    Messages:
    19
    Likes Received:
    1
    Code (Text):
    1. options:
    2.   minElevation: 2
    3.   maxElevation: 64
    4.   elevatorMaterial: emerald block
    5.   useUpDownMessages: false
    6.   up: &aYou have ascended a level.
    7.   down: &cYou have descended a level.
    8.   noPermission : &cYou do not have permission to do this.
    9.  
    10. on place:
    11.   if event-block is {@elevatorMaterial}:
    12.     if player has permission "simpleelevator.use":
    13.       set {_w} to location of event-block
    14.       loop all blocks above event-block:
    15.         if loop-block is air:
    16.           if block above loop-block is air:
    17.             set {_e} to location of loop-block
    18.             stop loop
    19.       if distance between {_w} and {_e} is less than {@maxElevation}:
    20.         if distance between {_w} and {_e} is greater than {@minElevation}:
    21.           send "&eElevator made!" to player
    22.         else:
    23.           cancel event
    24.           send "&eToo litte/Too long" to player
    25.       else:
    26.         cancel event
    27.         send "&eToo litte/Too long" to player
    28.     else:
    29.       send "{@noPermission}" to player
    30.  
    31. on sneak toggle:
    32.   if block under player is {@elevatorMaterial}:
    33.     loop all blocks under player:
    34.       if loop-block is air:
    35.         if block under loop-block is air:
    36.           teleport player to loop-block
    37.           if {@useUpDownMessages} is true:
    38.             send "{@down}" to player
    39.           stop loop
    40.  
    41. on jump:
    42.   if block under player is {@elevatorMaterial}:
    43.     loop all blocks above player:
    44.       if loop-block is air:
    45.         if block under loop-block is air:
    46.           teleport player to loop-block
    47.           if {@useUpDownMessages} is true:
    48.             send "{@up}" to player
    49.           stop loop
    Untested parsed sucessfully using skunity parser
     
    • Like Like x 1
  3. JaydenBee

    JaydenBee Member

    Joined:
    Nov 11, 2019
    Messages:
    36
    Likes Received:
    2
    wouldn't on place of {@elevatorMaterial} work?
     
  4. Conutik

    Conutik Member

    Joined:
    Jan 12, 2020
    Messages:
    19
    Likes Received:
    1
    it might work idk
     

Share This Page

Loading...