Region Parkour

  • 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!

DavidWasHere

New Member
Nov 14, 2020
6
0
1
23
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
 
(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:
command /parkour [<string>] [<string>]:
  permission: op
  cooldown: 1 second
  cooldown message: &4Please wait to do that again!
  permission message: &4You do not have permission to do that!
  trigger:
    if arg-1 is "create":
      if arg-2 is set:
        execute console command "/sudo %player% region define %arg-2%"
        send "&6Created region as long as that name is not an existing region" to player
        add %arg-2% to {parkours::*}
        execute console command "/sudo %player% region flag %arg-2% build deny"
        execute console command "/sudo %player% region flag %arg-2% pvp deny"
      else:
        send "&4Please specify a name of the region!" to player
    if arg-1 is "pos1":
      execute console command "/sudo %player% /pos1"
    if arg-1 is "pos2":
      execute console command "/sudo %player% /pos2"
    if arg-1 is "setspawn":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          set {parkour.spawn.%arg-2%} to player's location
          send "&6Set parkour spawn location for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&6Please state a valid name of an existing parkour!" to player
    if arg-1 is "delete":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          execute console command "/sudo %player% region delete %arg-2%"
          remove "%arg-2%" from {parkours::*}
          send "&6Removed the parkour named &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    if arg-1 is "setfinish":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          add player's location to {parkour.finish::*}
          send "&6Set finish for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    else:
      send "&4Usage /parkour [<string>] [<string>]" to player
    if arg-1 is "help":
      send "" to player
      send "No help section yet!" to player
      send "Skript made by Purple Pixel (On youtube)" to player

on walk on diamond_block:
  if {parkour.playing.%player%} is true:
    if {parkour.finish::*} contains player's location:
      #Put what u want to happen here I am just making it say u finished the parkour
      send "&6You have finished the parkour :D" to player
on leave:
  set {parkour.playing.%player%} to false

command /playparkour [<string>]:
  cooldown: 5 seconds
  cooldown message: &4Please wait to do that again!
  trigger:
    if {parkours::*} contains "%arg-1%":
      set {parkour.playing.%player%} to true
      send "&6 You have started a parkour!" to player
      execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    else:
      send "Parkours: %{parkours::*}%" to player
 
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
 
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:
command /parkour [<string>] [<string>]:
  permission: op
  cooldown: 1 second
  cooldown message: &4Please wait to do that again!
  permission message: &4You do not have permission to do that!
  trigger:
    if arg-1 is "create":
      if arg-2 is set:
        execute console command "/sudo %player% region define %arg-2%"
        send "&6Created region as long as that name is not an existing region" to player
        add arg-2 to {parkours::*}
        execute console command "/sudo %player% region flag %arg-2% build deny"
        execute console command "/sudo %player% region flag %arg-2% pvp deny"
      else:
        send "&4Please specify a name of the region!" to player
    if arg-1 is "pos1":
      execute console command "/sudo %player% /pos1"
    if arg-1 is "pos2":
      execute console command "/sudo %player% /pos2"
    if arg-1 is "setspawn":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          set {parkour.spawn.%arg-2%} to player's location
          send "&6Set parkour spawn location for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&6Please state a valid name of an existing parkour!" to player
    if arg-1 is "delete":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          execute console command "/sudo %player% region delete %arg-2%"
          remove "%arg-2%" from {parkours::*}
          send "&6Removed the parkour named &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    if arg-1 is "setfinish":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          add player's location to {parkour.finish::*}
          send "&6Set finish for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    else:
      send "&4Usage /parkour [<string>] [<string>]" to player
    if arg-1 is "help":
      send "" to player
      send "No help section yet!" to player
      send "Skript made by Purple Pixel (On youtube)" to player
 
on walk on diamond block:
  if {parkour.playing.%player%} is true:
    if {parkour.finish::*} contains player's location:
      #Put what u want to happen here I am just making it say u finished the parkour
      send "&6You have finished the parkour :D" to player
on quit:
  set {parkour.playing.%player%} to false
 
command /playparkour [<string>]:
  cooldown: 5 seconds
  cooldown message: &4Please wait to do that again!
  trigger:
    if {parkours::*} contains "%arg-1%":
      set {parkour.playing.%player%} to true
      send "&6 You have started a parkour!" to player
      execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    else:
      send "Parkours: %{parkours::*}%" to player
 
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:
command /parkour [<string>] [<string>]:
  permission: op
  cooldown: 1 second
  cooldown message: &4Please wait to do that again!
  permission message: &4You do not have permission to do that!
  trigger:
    if arg-1 is "create":
      if arg-2 is set:
        execute console command "/sudo %player% region define %arg-2%"
        send "&6Created region as long as that name is not an existing region" to player
        add arg-2 to {parkours::*}
        execute console command "/sudo %player% region flag %arg-2% build deny"
        execute console command "/sudo %player% region flag %arg-2% pvp deny"
      else:
        send "&4Please specify a name of the region!" to player
    if arg-1 is "pos1":
      execute console command "/sudo %player% /pos1"
    if arg-1 is "pos2":
      execute console command "/sudo %player% /pos2"
    if arg-1 is "setspawn":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          set {parkour.spawn.%arg-2%} to player's location
          send "&6Set parkour spawn location for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&6Please state a valid name of an existing parkour!" to player
    if arg-1 is "delete":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          execute console command "/sudo %player% region delete %arg-2%"
          remove "%arg-2%" from {parkours::*}
          send "&6Removed the parkour named &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    if arg-1 is "setfinish":
      if arg-2 is set:
        if {parkours::*} contains "%arg-2%":
          add player's location to {parkour.finish::*}
          send "&6Set finish for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    else:
      send "&4Usage /parkour [<string>] [<string>]" to player
    if arg-1 is "help":
      send "" to player
      send "No help section yet!" to player
      send "Skript made by Purple Pixel (On youtube)" to player
 
on walk on diamond block:
  if {parkour.playing.%player%} is true:
    if {parkour.finish::*} contains player's location:
      #Put what u want to happen here I am just making it say u finished the parkour
      send "&6You have finished the parkour :D" to player
on quit:
  set {parkour.playing.%player%} to false
 
command /playparkour [<string>]:
  cooldown: 5 seconds
  cooldown message: &4Please wait to do that again!
  trigger:
    if {parkours::*} contains "%arg-1%":
      set {parkour.playing.%player%} to true
      send "&6 You have started a parkour!" to player
      execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    else:
      send "Parkours: %{parkours::*}%" to player
There were some problems with "%arg-2%" so I fixed the fix to my fix.
Code:
command /parkour [<string>] [<string>]:
  permission: op
  cooldown: 1 second
  cooldown message: &4Please wait to do that again!
  permission message: &4You do not have permission to do that!
  trigger:
    if arg-1 is "create":
      if arg-2 is set:
        execute console command "/sudo %player% region define %arg-2%"
        send "&6Created region as long as that name is not an existing region" to player
        add arg-2 to {parkours::*}
        execute console command "/sudo %player% region flag %arg-2% build deny"
        execute console command "/sudo %player% region flag %arg-2% pvp deny"
      else:
        send "&4Please specify a name of the region!" to player
    if arg-1 is "pos1":
      execute console command "/sudo %player% /pos1"
    if arg-1 is "pos2":
      execute console command "/sudo %player% /pos2"
    if arg-1 is "setspawn":
      if arg-2 is set:
        if {parkours::*} contains arg-2:
          set {parkour.spawn.%arg-2%} to player's location
          send "&6Set parkour spawn location for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&6Please state a valid name of an existing parkour!" to player
    if arg-1 is "delete":
      if arg-2 is set:
        if {parkours::*} contains arg-2:
          execute console command "/sudo %player% region delete %arg-2%"
          remove arg-2 from {parkours::*}
          send "&6Removed the parkour named &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    if arg-1 is "setfinish":
      if arg-2 is set:
        if {parkours::*} contains arg-2:
          add player's location to {parkour.finish::*}
          send "&6Set finish for &6%arg-2%" to player
        else:
          send "&4Please state a valid name of an existing parkour!" to player
      else:
        send "&4Please state a valid name of an existing parkour!" to player
    else:
      send "&4Usage /parkour [<string>] [<string>]" to player
    if arg-1 is "help":
      send "" to player
      send "No help section yet!" to player
      send "Skript made by Purple Pixel (On youtube)" to player
 
on walk on diamond block:
  if {parkour.playing.%player%} is true:
    if {parkour.finish::*} contains player's location:
      #Put what u want to happen here I am just making it say u finished the parkour
      send "&6You have finished the parkour :D" to player
on quit:
  set {parkour.playing.%player%} to false
 
command /playparkour [<string>]:
  cooldown: 5 seconds
  cooldown message: &4Please wait to do that again!
  trigger:
    if {parkours::*} contains arg-1:
      set {parkour.playing.%player%} to true
      send "&6 You have started a parkour!" to player
      execute console command "/tp %player% %{parkour.spawn.%arg-1%}%"
    else:
      send "Parkours: %{parkours::*}%" to player