Solved team selection menu

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

lolib

Member
Oct 2, 2019
12
1
3
23
When player chooses a team Let the player's name appear in the information section how can i do

2024-10-28_17.08.21.png
 
Last edited:
There you go:

Code:
command /team [<text>]:
    trigger:
        arg 1 is not set:
            send "/team 1/2"
            stop
        arg 1 is "1":
            {team::%player%} is set:
                send "Already in a team."
                stop
            set {team::%player%} to true
            add player to {team::1::*}
            send "Choosen Team 1"
            stop
        arg 1 is "2":
            {team::%player%} is set:
                send "Already in a team."
                stop
            set {team::%player%} to true
            add player to {team::2::*}
            send "Choosen Team 2"
            stop
        arg 1 is "list":
            open chest with 1 row named "Teams" to player
            wait a tick
            loop {team::1::*}:
                add "%loop-value%" to {_players::*}
            set slot 2 of player's current inventory to red clay named "Team 1" with lore "&a||&e%{_players::*}%"
            loop {team::2::*}:
                add "%loop-value%" to {_players2::*}
            set slot 6 of player's current inventory to green clay named "Team 2" with lore "&a||&e%{_players2::*}%"
 
  • Like
Reactions: lolib
There you go:

Code:
command /team [<text>]:
    trigger:
        arg 1 is not set:
            send "/team 1/2"
            stop
        arg 1 is "1":
            {team::%player%} is set:
                send "Already in a team."
                stop
            set {team::%player%} to true
            add player to {team::1::*}
            send "Choosen Team 1"
            stop
        arg 1 is "2":
            {team::%player%} is set:
                send "Already in a team."
                stop
            set {team::%player%} to true
            add player to {team::2::*}
            send "Choosen Team 2"
            stop
        arg 1 is "list":
            open chest with 1 row named "Teams" to player
            wait a tick
            loop {team::1::*}:
                add "%loop-value%" to {_players::*}
            set slot 2 of player's current inventory to red clay named "Team 1" with lore "&a||&e%{_players::*}%"
            loop {team::2::*}:
                add "%loop-value%" to {_players2::*}
            set slot 6 of player's current inventory to green clay named "Team 2" with lore "&a||&e%{_players2::*}%"
Thank you bro
 
  • Like
Reactions: HiqqhFive