Solved Loop Player Group

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
code_language.skript:
loop all players:
    if loop-player's group is "redplayer":
        ...
    else if loop-player's group is "blueplayer":
        ...
I think it was so.
 
  • Like
Reactions: Yaşarhan
code_language.skript:
loop all players:
    if loop-player's group is "redplayer":
        ...
    else if loop-player's group is "blueplayer":
        ...
I think it was so.


Thanks sir, but I have to use it this way.
Code:
loop-player has permission "example.vip":

I have to set this up as a group, not a permission.
 
Last edited:
Code:
command /teamjoin <text>:
    description: &aJoin a Team!
    trigger:
        if arg is "red":
            if {team::%player%} isn't set:
                if player has permission "teams.red":
                    send "&aYou have joined team ""&cRed Team"""
                    set {team::%player%} to "red"
                    add player to {red::*}
                if player doesn't have permission "teams.red":
                    send "&cYou do not have permssion to join the team: &4""Red Team"""
            if {team::%player%} is set:
                send "&cYou have already joined a team!"
command /teammsg:
    trigger:
        if {team::%player%} is set:
            if {teammsg::%player%} is true:
                clear {teammsg::%player%}
                send "&cTeam MSG Set to FALSE!"
                stop
            if {teammsg::%player%} isn't set:
                set {teammsg::%player%} to true
                send "&aTeam MSG Set to TRUE!"
on chat:
    if {teammsg::%player%} is true:
        if {team::%player%} is "red":
            cancel event
            loop all players:
                if {team::%loop-player%} is "red":
                    send "&aTEAM CHAT &7(&cRed&7)&f: %message%" to loop-player
command /teamleave:
    trigger:
        if {team::%player%} is set:
            if {team::%player%} is "red":
                remove player from {red::*}
                clear {team::%player%}
                send "&cYou have left your team!"
        if {team::%player%} isn't set:
            send "&cYou are not in a team!"

Not sure if this is what you wanted, but here :emoji_slight_smile:
 
Code:
command /teamjoin <text>:
    description: &aJoin a Team!
    trigger:
        if arg is "red":
            if {team::%player%} isn't set:
                if player has permission "teams.red":
                    send "&aYou have joined team ""&cRed Team"""
                    set {team::%player%} to "red"
                    add player to {red::*}
                if player doesn't have permission "teams.red":
                    send "&cYou do not have permssion to join the team: &4""Red Team"""
            if {team::%player%} is set:
                send "&cYou have already joined a team!"
command /teammsg:
    trigger:
        if {team::%player%} is set:
            if {teammsg::%player%} is true:
                clear {teammsg::%player%}
                send "&cTeam MSG Set to FALSE!"
                stop
            if {teammsg::%player%} isn't set:
                set {teammsg::%player%} to true
                send "&aTeam MSG Set to TRUE!"
on chat:
    if {teammsg::%player%} is true:
        if {team::%player%} is "red":
            cancel event
            loop all players:
                if {team::%loop-player%} is "red":
                    send "&aTEAM CHAT &7(&cRed&7)&f: %message%" to loop-player
command /teamleave:
    trigger:
        if {team::%player%} is set:
            if {team::%player%} is "red":
                remove player from {red::*}
                clear {team::%player%}
                send "&cYou have left your team!"
        if {team::%player%} isn't set:
            send "&cYou are not in a team!"

Not sure if this is what you wanted, but here :emoji_slight_smile:

No if, no control, i need to loop players with a group, like looping players with an permission.
 
ok


Code:
loop all players:
    if loop-player has permission "example.vip":
        send "%loop-player%"
    if loop-player doesn't have permission "example.vip":
        send "%loop-player% doesn't have vip"
 
I already did this. Isn't there a way to loop the group.
What I wrote you earlier, right?
code_language.skript:
loop all players:
    if loop-player's group is "redplayer":
        #Code here
    if loop-player's group is "blueplayer":
        #Code here
    if loop-player's group is "vip":
        #Code here
 
  • Like
Reactions: Yaşarhan
Status
Not open for further replies.