How do you check to see if a player is on a specific team

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

Purple Pixel

Member
Sep 23, 2020
40
4
8
26
I would like to know if there is a way to check if a player is on a specific team. You know, with the vanilla /team
Can you guys help me out ASAP? I am making a custom skript for someone.
 
Code:
set {_team} to Bukkit.getScoreboardManager().getMainScoreboard().getPlayerTeam(player)
Skript-reflect or skript-mirror. Not tested!
 
Code:
set {_team} to Bukkit.getScoreboardManager().getMainScoreboard().getPlayerTeam(player)
Skript-reflect or skript-mirror. Not tested!
Could you please explain this? Could I just use set {_team} to .getPlayerTeam()?
 
Code:
command /checkteam [<player>]:
    trigger:
        set {_team} to Bukkit.getScoreboardManager().getMainScoreboard().getPlayerTeam(arg-1)
        send "Player %arg-1% is in %{_team}% team."
[doublepost=1604424840,1604424066][/doublepost]Please change post's status to solved if this code worked for you.
 
Code:
command /checkteam [<player>]:
    trigger:
        set {_team} to Bukkit.getScoreboardManager().getMainScoreboard().getPlayerTeam(arg-1)
        send "Player %arg-1% is in %{_team}% team."
I want to check if all players the players onlines team is "events" and if it is I want it to add them to a list
 
I suggest you to read more about Skript and how to use it.
Code:
command /checkteam [<player>]:
    trigger:
        set {_team} to Bukkit.getScoreboardManager().getMainScoreboard().getPlayerTeam(arg-1)
        if {_team} contains "events":
            send "Player %arg-1% is in &levents &fteam."
 
Status
Not open for further replies.