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 Loop Player Group

Discussion in 'Skript' started by Yaşarhan, Jun 15, 2020.

Thread Status:
Not open for further replies.
  1. Yaşarhan

    Yaşarhan Active Member

    Joined:
    May 16, 2020
    Messages:
    87
    Likes Received:
    6
    First of all thank you for your interest.

    I just want to loop players from a few groups.

    Groups:
    1) redplayer
    2) blueplayer

    Thanks.

     
  2. Best Answer:
    Post #8 by couger44, Jun 18, 2020
  3. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Code (Skript):
    1. loop all players:
    2.     if loop-player's group is "redplayer":
    3.         ...
    4.     else if loop-player's group is "blueplayer":
    5.         ...
    I think it was so.
     
    • Like Like x 1
  4. Yaşarhan

    Yaşarhan Active Member

    Joined:
    May 16, 2020
    Messages:
    87
    Likes Received:
    6

    Thanks sir, but I have to use it this way.
    Code (Text):
    1. loop-player has permission "example.vip":
    I have to set this up as a group, not a permission.
     
    #3 Yaşarhan, Jun 16, 2020
    Last edited: Jun 16, 2020
  5. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    5
    Code (Text):
    1.  
    2.  
    3. command /teamjoin <text>:
    4.     description: &aJoin a Team!
    5.     trigger:
    6.         if arg is "red":
    7.             if {team::%player%} isn't set:
    8.                 if player has permission "teams.red":
    9.                     send "&aYou have joined team ""&cRed Team"""
    10.                     set {team::%player%} to "red"
    11.                     add player to {red::*}
    12.                 if player doesn't have permission "teams.red":
    13.                     send "&cYou do not have permssion to join the team: &4""Red Team"""
    14.             if {team::%player%} is set:
    15.                 send "&cYou have already joined a team!"
    16. command /teammsg:
    17.     trigger:
    18.         if {team::%player%} is set:
    19.             if {teammsg::%player%} is true:
    20.                 clear {teammsg::%player%}
    21.                 send "&cTeam MSG Set to FALSE!"
    22.                 stop
    23.             if {teammsg::%player%} isn't set:
    24.                 set {teammsg::%player%} to true
    25.                 send "&aTeam MSG Set to TRUE!"
    26. on chat:
    27.     if {teammsg::%player%} is true:
    28.         if {team::%player%} is "red":
    29.             cancel event
    30.             loop all players:
    31.                 if {team::%loop-player%} is "red":
    32.                     send "&aTEAM CHAT &7(&cRed&7)&f: %message%" to loop-player
    33. command /teamleave:
    34.     trigger:
    35.         if {team::%player%} is set:
    36.             if {team::%player%} is "red":
    37.                 remove player from {red::*}
    38.                 clear {team::%player%}
    39.                 send "&cYou have left your team!"
    40.         if {team::%player%} isn't set:
    41.             send "&cYou are not in a team!"
    42.  
    43.  
    44.  
    Not sure if this is what you wanted, but here :emoji_slight_smile:
     
  6. Yaşarhan

    Yaşarhan Active Member

    Joined:
    May 16, 2020
    Messages:
    87
    Likes Received:
    6
    No if, no control, i need to loop players with a group, like looping players with an permission.
     
  7. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    5
    ok


    Code (Text):
    1.  
    2. loop all players:
    3.     if loop-player has permission "example.vip":
    4.         send "%loop-player%"
    5.     if loop-player doesn't have permission "example.vip":
    6.         send "%loop-player% doesn't have vip"
    7.  
     
  8. Yaşarhan

    Yaşarhan Active Member

    Joined:
    May 16, 2020
    Messages:
    87
    Likes Received:
    6
    I already did this. Isn't there a way to loop the group.
     
  9. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    What I wrote you earlier, right?
    Code (Skript):
    1. loop all players:
    2.     if loop-player's group is "redplayer":
    3.         #Code here
    4.     if loop-player's group is "blueplayer":
    5.         #Code here
    6.     if loop-player's group is "vip":
    7.         #Code here
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...