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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

I am re-making bridge duels from hypixel

Discussion in 'Skript' started by Bob Brooklyn, Dec 12, 2020.

Thread Status:
Not open for further replies.
  1. Bob Brooklyn

    Bob Brooklyn Member

    Joined:
    Dec 12, 2020
    Messages:
    2
    Likes Received:
    0
    basically, I want it so when {player.1} dies, it cancels the event and teleports them to (231, 152, -195, world). right now (no error message), it cancels the event but doesn't teleport {player.1} . please help

    Code (Text):
    1. #The duel command
    2. command /bridgeduel <player>:
    3.     trigger:
    4. # putting players into variables
    5.         clear {ingame}
    6.         clear {player.1}
    7.         clear {player.2}
    8.         make player execute command "/p1"
    9.         make arg-1 execute command "/p2"
    10.         set {player.1} to player
    11.         set {ingame} to player
    12.         teleport player to location(231, 152, -195, world)
    13.         make player execute command "/gamemode survival"
    14.         set {player.2} to arg-1
    15.         set {ingame} to arg-1
    16.         set {%player%.points} to 0
    17.         teleport arg-1 to location(231, 152, -251, world)
    18. # setting up the kits
    19.         clear player's inventory
    20.         give player wooden sword
    21.         give player 64 blue wool
    22.         give player 3 golden apple
    23.         give player bow
    24.         give player 4 arrows
    25.         make arg-1 execute command "/gamemode survival"
    26.         clear arg-1's inventory
    27.         give arg-1 wooden sword
    28.         give arg-1 64 red wool
    29.         give arg-1 3 golden apple
    30.         give arg-1 bow
    31.         give arg-1 4 arrows
    32. on step on black carpet:
    33.     if player is {player.2}:
    34.         heal {player.1}
    35.         heal {player.2}
    36.         add 1 to {%player%.points}
    37.         broadcast "%player% Has &3%{%player%.points}% Points"
    38.         teleport {player.1} to location(231, 152, -195, world)
    39.         teleport {player.2} to location(231, 152, -251, world)
    40.         if {%player%.points} >= 5:
    41.             set {%player%.points} to 0
    42.             broadcast "&a%player% &3Now has &45 &3Points and has Won the Game!"
    43.             send title "&2%player%" with subtitle "Has Scored 5 Points and Won the Game " for 3 seconds
    44.         if {%player%.points} < 5:
    45.             send title "&2%player%" with subtitle "Has Scored!" for 1 seconds
    46.     if player is {player.1}:
    47.         send "&4You can't score in your own goal!"
    48.         teleport player to location(231, 152, -195, world)
    49. on death:
    50.     if player is {ingame}:
    51.         cancel event
    52.         if player is {player.1}:
    53.             teleport player to location(231, 152, -195, world)
    54. command /tpoop:
    55.     trigger:
    56.         teleport {player.1} to location(231, 152, -195, world)
    57. on step on red mushroom block:
    58.     heal {player.1}
    59.     heal {player.2}
    60.     if player is {player.1}:  
    61.         add 1 to {%player%.points}
    62.         broadcast "%player% Has &3%{%player%.points}% Points"
    63.  
    64. #
    65. #    send "points set to 0"
    66.     if {%player%.points} >= 5:
    67.         broadcast "&a%player% &3Now has &45 &3Points and has Won the Game!"
    68.         set {%player%.points} to 0
    69.         broadcast "&a%player% &3Now has &45 &3Points and has Won the Game!"
    70.         send title "&2%player%" with subtitle "Has Scored 5 Points and Won the Game " for 3 seconds
    71.         teleport {player.1} to location(231, 152, -195, world)
    72.         teleport {player.2} to location(231, 152, -251, world)
    73.         clear {player.1}
    74.         clear {player.2}
    75.     if {%player%.points} < 5:
    76.         send title "&2%player%" with subtitle "Has Scored!" for 3 seconds
    77.         teleport {player.1} to location(231, 152, -195, world)
    78.         teleport {player.2} to location(231, 152, -251, world)
    79. #    send "points set to 0"
    80.  
    81.  
    82. command /p2:  
    83.     trigger:
    84.         set {player.2} to player
    85.  
    86. command /p1:  
    87.     trigger:
    88.         set {player.1} to player
    89. command /test:
    90.     trigger:
    91.         if player is {ingame}:
    92.             send "you are {ingame}"
    93. command /test1:
    94.     trigger:
    95.         if {player.1} is player:
    96.             send "hi" to {player.1}
    97. command /resetplayer:
    98.     trigger:
    99.         clear {ingame}
    100.         clear {player.1}
    101.         clear {player.2}
    102. command /ingame:
    103.     trigger:
    104.         set {ingame} to player
    105. command /playersingame:
    106.     trigger:
    107.         if player is {player.1}:
    108.             send "you are {player.1}" to {player.1}
    109.         if player is {player.2}:
    110.             send "you are {player.2}" to {player.2}
     
  2. Jakkeren

    Supporter

    Joined:
    Mar 23, 2017
    Messages:
    63
    Likes Received:
    3
    I'd set the location to a variable using a command, teleporting the player to the variable afterwards. This would also make the location changeable in-game.

    Code (Text):
    1. command /setloc:
    2.     trigger:
    3.         set {loc} to location of player
    Code (Text):
    1. teleport arg-1 to {loc}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...