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.

Region Parkour

Discussion in 'Requests' started by DavidWasHere, Nov 14, 2020.

  1. DavidWasHere

    DavidWasHere New Member

    Joined:
    Nov 14, 2020
    Messages:
    6
    Likes Received:
    0
    Category: Minigame

    Suggested name: Region Parkour

    Spigot/Skript Version: 1.16.3

    What I want:
    I want a Parkour that i can set a region (like world edit) for checkpoints and rewards (for example, everytime you go into a checkpoint you get certain amount of coins)

    Ideas for commands:
    /parkourpos1 - Position 1 of region
    /parkourpos2 - Position 2 of region
    /parkourfinish - Set the finish of the parkour according to the set region
    /parkourspawn - Set the spawn of the parkour according to the set region

    Ideas for permissions:
    None

    When I'd like it by: Anytime
     
  2. Purple Pixel

    Purple Pixel Member

    Joined:
    Sep 23, 2020
    Messages:
    40
    Likes Received:
    3
    I'd like to know if you are using a plugin called "World Guard" if so I could help you.
     
  3. DavidWasHere

    DavidWasHere New Member

    Joined:
    Nov 14, 2020
    Messages:
    6
    Likes Received:
    0
    yes i am
     
  4. Purple Pixel

    Purple Pixel Member

    Joined:
    Sep 23, 2020
    Messages:
    40
    Likes Received:
    3
    (Requires: World Edit, World Guard, and Skript)
    Ok so for this you will have to start by putting /parkour pos1 then /parkour pos2 then to create the parkour do /parkour create <parkour name> after that you can then do /parkour setspawn <parkour name> then /parkour setfinish <parkour name> MAKE SURE THE END OF THE PARKOUR IS ON A DIAMOND_BLOCK! Also, I made something in the code where you can make it do what you want when they finish. I have it just to say You completed the parkour! I Have not tested this code yet so it is probably not going to work but just atleast try it. When I get the chance I will try to test it and to fix it. Then I will reply with another. Also, to join a parkour do /playparkour <parkour name>. On leave it will remove you from the "playing" list.

    -Purple Pixel
    Code (Text):
    1. command /parkour [<string>] [<string>]:
    2.   permission: op
    3.   cooldown: 1 second
    4.   cooldown message: &4Please wait to do that again!
    5.   permission message: &4You do not have permission to do that!
    6.   trigger:
    7.     if arg-1 is "create":
    8.       if arg-2 is set:
    9.         execute console command "/sudo %player% region define %arg-2%"
    10.         send "&6Created region as long as that name is not an existing region" to player
    11.         add %arg-2% to {parkours::*}
    12.         execute console command "/sudo %player% region flag %arg-2% build deny"
    13.         execute console command "/sudo %player% region flag %arg-2% pvp deny"
    14.       else:
    15.         send "&4Please specify a name of the region!" to player
    16.     if arg-1 is "pos1":
    17.       execute console command "/sudo %player% /pos1"
    18.     if arg-1 is "pos2":
    19.       execute console command "/sudo %player% /pos2"
    20.     if arg-1 is "setspawn":
    21.       if arg-2 is set:
    22.         if {parkours::*} contains "%arg-2%":
    23.           set {parkour.spawn.%arg-2%} to player's location
    24.           send "&6Set parkour spawn location for &6%arg-2%" to player
    25.         else:
    26.           send "&4Please state a valid name of an existing parkour!" to player
    27.       else:
    28.         send "&6Please state a valid name of an existing parkour!" to player
    29.     if arg-1 is "delete":
    30.       if arg-2 is set:
    31.         if {parkours::*} contains "%arg-2%":
    32.           execute console command "/sudo %player% region delete %arg-2%"
    33.           remove "%arg-2%" from {parkours::*}
    34.           send "&6Removed the parkour named &6%arg-2%" to player
    35.         else:
    36.           send "&4Please state a valid name of an existing parkour!" to player
    37.       else:
    38.         send "&4Please state a valid name of an existing parkour!" to player
    39.     if arg-1 is "setfinish":
    40.       if arg-2 is set:
    41.         if {parkours::*} contains "%arg-2%":
    42.           add player's location to {parkour.finish::*}
    43.           send "&6Set finish for &6%arg-2%" to player
    44.         else:
    45.           send "&4Please state a valid name of an existing parkour!" to player
    46.       else:
    47.         send "&4Please state a valid name of an existing parkour!" to player
    48.     else:
    49.       send "&4Usage /parkour [<string>] [<string>]" to player
    50.     if arg-1 is "help":
    51.       send "" to player
    52.       send "No help section yet!" to player
    53.       send "Skript made by Purple Pixel (On youtube)" to player
    54.  
    55. on walk on diamond_block:
    56.   if {parkour.playing.%player%} is true:
    57.     if {parkour.finish::*} contains player's location:
    58.       #Put what u want to happen here I am just making it say u finished the parkour
    59.       send "&6You have finished the parkour :D" to player
    60. on leave:
    61.   set {parkour.playing.%player%} to false
    62.  
    63. command /playparkour [<string>]:
    64.   cooldown: 5 seconds
    65.   cooldown message: &4Please wait to do that again!
    66.   trigger:
    67.     if {parkours::*} contains "%arg-1%":
    68.       set {parkour.playing.%player%} to true
    69.       send "&6 You have started a parkour!" to player
    70.       execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    71.     else:
    72.       send "Parkours: %{parkours::*}%" to player
    73.    
    74.  
     
  5. DavidWasHere

    DavidWasHere New Member

    Joined:
    Nov 14, 2020
    Messages:
    6
    Likes Received:
    0
    sadly it did not work first time, it gave me those errors:

    [22:39:44 ERROR]: [Skript] '%arg-2%' can't be added to {parkours::*} because the former is not an object (Parkour.sk, line 11: add %arg-2% to {parkours::*}')
    [22:39:44 WARN]: [Skript] the 2nd argument is already a text, so you should not put it in one (e.g. the 2nd argument instead of "%the 2nd argument%") (Parkour.sk, line 22: if {parkours::*} contains "%arg-2%":')
    [22:39:45 WARN]: [Skript] the 2nd argument is already a text, so you should not put it in one (e.g. the 2nd argument instead of "%the 2nd argument%") (Parkour.sk, line 31: if {parkours::*} contains "%arg-2%":')
    [22:39:45 WARN]: [Skript] the 2nd argument is already a text, so you should not put it in one (e.g. the 2nd argument instead of "%the 2nd argument%") (Parkour.sk, line 33: remove "%arg-2%" from {parkours::*}')
    [22:39:45 WARN]: [Skript] the 2nd argument is already a text, so you should not put it in one (e.g. the 2nd argument instead of "%the 2nd argument%") (Parkour.sk, line 41: if {parkours::*} contains "%arg-2%":')
    [22:39:45 ERROR]: [Skript] can't understand this event: 'on leave' (Parkour.sk, line 60: on leave:')
    [22:39:45 ERROR]: [Skript] can't understand this event: 'on walk on diamond_block' (Parkour.sk, line 55: on walk on diamond_block:')
    [22:39:45 WARN]: [Skript] the 1st argument is already a text, so you should not put it in one (e.g. the 1st argument instead of "%the 1st argument%") (Parkour.sk, line 67: if {parkours::*} contains "%arg-1%":')


    also, just a fyi so you dont get confused (i couldnt test it so idk if you did what i said) i want the /parkour pos1 and /parkour pos2 to set each checkpoint so like:

    /parkour pos1 (sets the pos1 of checkpoint 1)
    /parkour pos2 (sets the pos2 of checkpoint 1)
    /parkour setcheckpoint 1 (sets the spawn of the checkpoint)
    - sets the area of one checkpoint, so when a player hits the region it saves the spawn (/parkour setcheckpoint) and when the player falls into the void it teleports him back to the checkpoint, also, if it wasnt too much i would like to give a reward for each checkpoint
     
  6. ESW_ST33le

    ESW_ST33le Member

    Joined:
    May 6, 2020
    Messages:
    32
    Likes Received:
    1
    this should fix everything, [22:39:45 WARN]: [Skript] the 1st argument is already a text, so you should not put it in one (e.g. the 1st argument instead of "%the 1st argument%") (Parkour.sk, line 67: if {parkours::*} contains "%arg-1%":') that is not an error and wont hurt the skript
    Code (Text):
    1. command /parkour [<string>] [<string>]:
    2.   permission: op
    3.   cooldown: 1 second
    4.   cooldown message: &4Please wait to do that again!
    5.   permission message: &4You do not have permission to do that!
    6.   trigger:
    7.     if arg-1 is "create":
    8.       if arg-2 is set:
    9.         execute console command "/sudo %player% region define %arg-2%"
    10.         send "&6Created region as long as that name is not an existing region" to player
    11.         add arg-2 to {parkours::*}
    12.         execute console command "/sudo %player% region flag %arg-2% build deny"
    13.         execute console command "/sudo %player% region flag %arg-2% pvp deny"
    14.       else:
    15.         send "&4Please specify a name of the region!" to player
    16.     if arg-1 is "pos1":
    17.       execute console command "/sudo %player% /pos1"
    18.     if arg-1 is "pos2":
    19.       execute console command "/sudo %player% /pos2"
    20.     if arg-1 is "setspawn":
    21.       if arg-2 is set:
    22.         if {parkours::*} contains "%arg-2%":
    23.           set {parkour.spawn.%arg-2%} to player's location
    24.           send "&6Set parkour spawn location for &6%arg-2%" to player
    25.         else:
    26.           send "&4Please state a valid name of an existing parkour!" to player
    27.       else:
    28.         send "&6Please state a valid name of an existing parkour!" to player
    29.     if arg-1 is "delete":
    30.       if arg-2 is set:
    31.         if {parkours::*} contains "%arg-2%":
    32.           execute console command "/sudo %player% region delete %arg-2%"
    33.           remove "%arg-2%" from {parkours::*}
    34.           send "&6Removed the parkour named &6%arg-2%" to player
    35.         else:
    36.           send "&4Please state a valid name of an existing parkour!" to player
    37.       else:
    38.         send "&4Please state a valid name of an existing parkour!" to player
    39.     if arg-1 is "setfinish":
    40.       if arg-2 is set:
    41.         if {parkours::*} contains "%arg-2%":
    42.           add player's location to {parkour.finish::*}
    43.           send "&6Set finish for &6%arg-2%" to player
    44.         else:
    45.           send "&4Please state a valid name of an existing parkour!" to player
    46.       else:
    47.         send "&4Please state a valid name of an existing parkour!" to player
    48.     else:
    49.       send "&4Usage /parkour [<string>] [<string>]" to player
    50.     if arg-1 is "help":
    51.       send "" to player
    52.       send "No help section yet!" to player
    53.       send "Skript made by Purple Pixel (On youtube)" to player
    54.  
    55. on walk on diamond block:
    56.   if {parkour.playing.%player%} is true:
    57.     if {parkour.finish::*} contains player's location:
    58.       #Put what u want to happen here I am just making it say u finished the parkour
    59.       send "&6You have finished the parkour :D" to player
    60. on quit:
    61.   set {parkour.playing.%player%} to false
    62.  
    63. command /playparkour [<string>]:
    64.   cooldown: 5 seconds
    65.   cooldown message: &4Please wait to do that again!
    66.   trigger:
    67.     if {parkours::*} contains "%arg-1%":
    68.       set {parkour.playing.%player%} to true
    69.       send "&6 You have started a parkour!" to player
    70.       execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    71.     else:
    72.       send "Parkours: %{parkours::*}%" to player
     
  7. Purple Pixel

    Purple Pixel Member

    Joined:
    Sep 23, 2020
    Messages:
    40
    Likes Received:
    3
    There were some problems with "%arg-2%" so I fixed the fix to my fix.
    Code (Text):
    1. command /parkour [<string>] [<string>]:
    2.   permission: op
    3.   cooldown: 1 second
    4.   cooldown message: &4Please wait to do that again!
    5.   permission message: &4You do not have permission to do that!
    6.   trigger:
    7.     if arg-1 is "create":
    8.       if arg-2 is set:
    9.         execute console command "/sudo %player% region define %arg-2%"
    10.         send "&6Created region as long as that name is not an existing region" to player
    11.         add arg-2 to {parkours::*}
    12.         execute console command "/sudo %player% region flag %arg-2% build deny"
    13.         execute console command "/sudo %player% region flag %arg-2% pvp deny"
    14.       else:
    15.         send "&4Please specify a name of the region!" to player
    16.     if arg-1 is "pos1":
    17.       execute console command "/sudo %player% /pos1"
    18.     if arg-1 is "pos2":
    19.       execute console command "/sudo %player% /pos2"
    20.     if arg-1 is "setspawn":
    21.       if arg-2 is set:
    22.         if {parkours::*} contains arg-2:
    23.           set {parkour.spawn.%arg-2%} to player's location
    24.           send "&6Set parkour spawn location for &6%arg-2%" to player
    25.         else:
    26.           send "&4Please state a valid name of an existing parkour!" to player
    27.       else:
    28.         send "&6Please state a valid name of an existing parkour!" to player
    29.     if arg-1 is "delete":
    30.       if arg-2 is set:
    31.         if {parkours::*} contains arg-2:
    32.           execute console command "/sudo %player% region delete %arg-2%"
    33.           remove arg-2 from {parkours::*}
    34.           send "&6Removed the parkour named &6%arg-2%" to player
    35.         else:
    36.           send "&4Please state a valid name of an existing parkour!" to player
    37.       else:
    38.         send "&4Please state a valid name of an existing parkour!" to player
    39.     if arg-1 is "setfinish":
    40.       if arg-2 is set:
    41.         if {parkours::*} contains arg-2:
    42.           add player's location to {parkour.finish::*}
    43.           send "&6Set finish for &6%arg-2%" to player
    44.         else:
    45.           send "&4Please state a valid name of an existing parkour!" to player
    46.       else:
    47.         send "&4Please state a valid name of an existing parkour!" to player
    48.     else:
    49.       send "&4Usage /parkour [<string>] [<string>]" to player
    50.     if arg-1 is "help":
    51.       send "" to player
    52.       send "No help section yet!" to player
    53.       send "Skript made by Purple Pixel (On youtube)" to player
    54.  
    55. on walk on diamond block:
    56.   if {parkour.playing.%player%} is true:
    57.     if {parkour.finish::*} contains player's location:
    58.       #Put what u want to happen here I am just making it say u finished the parkour
    59.       send "&6You have finished the parkour :D" to player
    60. on quit:
    61.   set {parkour.playing.%player%} to false
    62.  
    63. command /playparkour [<string>]:
    64.   cooldown: 5 seconds
    65.   cooldown message: &4Please wait to do that again!
    66.   trigger:
    67.     if {parkours::*} contains arg-1:
    68.       set {parkour.playing.%player%} to true
    69.       send "&6 You have started a parkour!" to player
    70.       execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    71.     else:
    72.       send "Parkours: %{parkours::*}%" to player
     

Share This Page

Loading...