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.

Solved Teleport all players to a location if true

Discussion in 'Requests' started by JrapS, Apr 2, 2022.

  1. JrapS

    JrapS Member

    Apr 2, 2022
    Likes Received:
    I'm making a minigame.
    for this minigame i need to do teleport all players to another locations like "Komutcu", or "Gardiyan" or "Oyuncu" I tryed to make it but i can't do :/ I'm almost new at skript.

    Code (Text):
    1. on respawn:
    2.   if {komutcu.%player%} is "true":
    3.     loop {komutcu.}:    
    4.       teleport loop-value to 201 157 472
    5.     loop {gardiyan.%player%}:    
    6.       teleport loop-value to 201 157 472
    7.       else:
    8.         teleport loop-value to 201 147 472
    I tryed to do like that but it doesnt work :/ How can i make it?

    With Regards,
  2. Best Answer:
    Post #2 by Mich, Apr 3, 2022
  3. Mich

    Mich Active Member

    Jul 15, 2020
    Likes Received:
    Code (Text):
    1. #This is a example because I don't know how yo join the mini game you can change this.
    2. Command /join:
    3.     Trigger:
    4.         If {minigame::%player%} exists:
    5.             Message "you already join the game"
    6.         Else:
    7.             Set {minigame::%player%} to true
    8.             Message "you join mini game name"
    10. Command /leave:
    11.     Trigger:
    12.         If {minigame::%player%} exists:
    13.             Delete {minigame::%player%}
    14.             Message "you leave mini game name"
    15.         Else:
    16.             Message "you are not in a game"
    18. #idk how do you start the game but this is an example
    19. Command /start:
    20.     Trigger:
    21.         Message "minigame started" to {minigame::*} # message all players inside the list
    22.         Loop {minigame::*}:
    23.             Teleport loop-value to {game} # you can set the game location
    24. #set the game location
    25. Command /setgamelocation:
    26.     Trigger:
    27.         Set {game} at the player's location
    28.         Message "game location set at %{game}%"

Share This Page