Check if a list contains a player

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

AQika

Member
Jun 28, 2023
31
3
8
I am making this lava rising minigame, and im trying to make it so that a player does not get the kit again if he reconnects to the server

I am having issues at checking if the player is not contained in the list {hasbeenhere::*}

Code:
on join:
    set join message to "&7[&a+&7] %player%"
    wait 5 ticks
    if {started} is true:
        if {isLavaRising} is true:
            wait 1 tick
            make console execute command "/mvtp %player% lava"
            wait 2 tick
            set gamemode of player to spectator
            clear player's inventory
            wait 2 tick
            send "&eYou joined late."
            send "&aBut dont worry, more events are starting."
        else if {isLavaRising} is false:
            wait 1 tick
            make console execute command "/mvtp %player% lava"
            set gamemode of player to survival
            loop {hasbeenhere::*}:
                broadcast "%loop-value%"
                if loop-value != player:
                    clear player's inventory
                    kit(player)
                    send "&eYou joined late but you can still play!"
                    add player to {hasbeenhere::*}
            add player to {alive::*}
    else if {started} is false:
        make console execute command "/mvtp %player% world"
        clear player's inventory
 
To check if a list contains a player you can simply use;

Code:
if {hasbeenhere::*} contains player:
 
To check if a list contains a player you can simply use;

Code:
if {hasbeenhere::*} contains player:
It did not fix it since contain is broken, but i used a function someone made that replicates contain! Ty for the idea