Issues searching for a value in a list variable

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

    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!

DannyDaMannyy

Member
Dec 16, 2023
20
1
3
Trying to get a system so players can choose which team they want to be on. When they choose that team, I want it to add them to a list variable. But I cant find a value in the list variable! If I broadcast it, I get the contents of the variable accurately. It's a series of player names. But HOW DO I DETECT IF A SPECIFIC PLAYER NAME exists in the list variable?!

Code ive been using to test:
Code:
command /lol:
    trigger:     
        loop {teamred::*}:
            if {teamred::%player%} is event-player's name:
                send "You are a member of Team RED!" to player
            else:
                set {_gui} to a new chest inventory with 1 row named "&cTeam &aSelector"
                set slot 1 of {_gui} to red wool named "&cRED TEAM" with lore "Click this to choose team red!"
                open {_gui} to player
                send "You have not chosen a team yet!" to player
 
figured it out! Had to use this phrase instead:
Code:
set {player::*} to player's name
if {teamred::*} does not contain {player::*}:
    send "&cIt worked!!" to all players