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.

Solved Why does it only teleport 1 player to me?

Discussion in 'Skript' started by Adrihun, May 31, 2017.

Thread Status:
Not open for further replies.
  1. Adrihun

    Adrihun Member

    Joined:
    Feb 1, 2017
    Messages:
    368
    Likes Received:
    6
    Code (Skript):
    1.                     if arg-1 is "all":
    2.                         if player has permission "tag.owner":
    3.                             loop all players:
    4.                                 loop-player isn't player
    5.                                 teleport loop-player to player
    6.                                 send "&9Teleport> &7All players have been teleported to &e%player%." to loop-player
    7.                                 stop
    8.                         else:
    9.                             send "&9Permissions> &7This requires Permission Rank [&9OWNER&7]."
    10.                             stop
     
  2. Best Answer:
    Post #2 by ShaneBee, May 31, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Remove "stop".
    --- Double Post Merged, May 31, 2017, Original Post Date: May 31, 2017 ---
    (Line 7)
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    @Donut How do you count loop players?
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    What do you mean? If you're asking how many players it will loop its just %amount of players online% (I think that's the expression or something similar just check the docs)
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    I don't want to include the player who teleported the players
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Seriously... %amount of players online% - 1 this isn't rocket science
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Can't understand this expression: amount of players online
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    I said the expression is something like that check the docs
    --- Double Post Merged, May 31, 2017, Original Post Date: May 31, 2017 ---
    %amount of all players%
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Code (Skript):
    1.                     if arg-1 is "all":
    2.                         if player has permission "tag.owner":
    3.                             loop all players:
    4.                                 loop-player isn't player
    5.                                 teleport loop-player to player
    6.                                 send "&9Teleport> &7All players have been teleported to &e%player%." to loop-player
    7.                                 send "%amount of all players-1%" to player
    8.                         else:
    9.                             send "&9Permissions> &7This requires Permission Rank [&9OWNER&7]."
    10.                             stop
    Why does it say it twice?
     
  11. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    You're sending it to player not loop-player so it's sending it to the person who runs the command every time it loops
     
  12. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    so what do i do
     
  13. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    If you want it sent to the person who ran the command do it before or after the loop
    --- Double Post Merged, May 31, 2017, Original Post Date: May 31, 2017 ---
    Not inside it
     
    • Like Like x 1
  14. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Seriously, some people here need to use common sense :emoji_grinning:
     
  15. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    ^ me whenever I read one of @Adrihun's posts
     
    • Agree Agree x 1
  16. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Try this one:

    Code (Skript):
    1.                     if arg-1 is "all":
    2.                         if player has permission "tag.owner":
    3.                                 wait 1 tick
    4.                                 teleport all players to player
    5.                                 wait 3 ticks
    6.                                 send "&9Teleport> &7All players have been teleported to &e%player%." to loop-player
    7.                                 stop
    8.                         else:
    9.                             send "&9Permissions> &7This requires Permission Rank [&9OWNER&7]."
    10.                             stop trigger
    11.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...