Solved Skript help - Defining multiple list variables in "contains"

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

CustomWorldYT

Member
Jun 17, 2018
15
0
0
Skript Version: 2.2 dev36 (latest)
Skript Author: Bensku
Minecraft Version: 1.12


I'm trying to do ranks for my FreeOP server in Skript. I can't use permissions, because it's FreeOP (where everyone is opped). I have in game command for setting rank. But now I want to define multiple list variables in "contains", so if player is in moderator list or in helper list (for example), it will do certain action, else cancel the event: player is not staff. I have tired to put the variables in brackets, but it always kept canceling the event, just like if player wasn't staff, even if he was in the {list::variable::*} list variable. My question is, how to define multiple list variables in 'contains' properly.
---
Code:

code_language.skript:
command /setrank <player> <text>:
    executable by: console
    trigger:
        if arg 1 is set:
            if arg 2 is set:
                if arg 2 is "helper":
                    add argument 1 to {staff::helpers::*}
                    broadcast "Adding &e%arg 1% &cto the helpers list."
                    stop
                if arg 2 is "moderator" or "mods":
                    add argument 1 to {staff::moderators::*}
                    broadcast "Adding &e%arg 1% &cto the moderators list."
                    stop 
                if arg 2 is "owner":
                    add argument 1 to {staff::owners::*}
                    broadcast "&c&lAdding &e%arg 1% &cto the &lOWNERS &clist."
                    stop 
                else:
                    message "Invalid rank" to player
                   
command /test:
    trigger:
       [B] if ({staff::moderators::*}, {staff::helpers::*} or {staff::owners}) contains player's name:[/B]
            message "works" to player
        else:
            message "sad panda :(" to player

Errors on Reload:

code_language.skript:
None.

Console errors:
code_language.skript:
none

Other Useful Info:

Addons using (including versions):
None

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I tired to do it without brackets, but the result was same.
 
Skript Version: 2.2 dev36 (latest)
Skript Author: Bensku
Minecraft Version: 1.12


I'm trying to do ranks for my FreeOP server in Skript. I can't use permissions, because it's FreeOP (where everyone is opped). I have in game command for setting rank. But now I want to define multiple list variables in "contains", so if player is in moderator list or in helper list (for example), it will do certain action, else cancel the event: player is not staff. I have tired to put the variables in brackets, but it always kept canceling the event, just like if player wasn't staff, even if he was in the {list::variable::*} list variable. My question is, how to define multiple list variables in 'contains' properly.
---
Code:

code_language.skript:
command /setrank <player> <text>:
    executable by: console
    trigger:
        if arg 1 is set:
            if arg 2 is set:
                if arg 2 is "helper":
                    add argument 1 to {staff::helpers::*}
                    broadcast "Adding &e%arg 1% &cto the helpers list."
                    stop
                if arg 2 is "moderator" or "mods":
                    add argument 1 to {staff::moderators::*}
                    broadcast "Adding &e%arg 1% &cto the moderators list."
                    stop
                if arg 2 is "owner":
                    add argument 1 to {staff::owners::*}
                    broadcast "&c&lAdding &e%arg 1% &cto the &lOWNERS &clist."
                    stop
                else:
                    message "Invalid rank" to player
                  
command /test:
    trigger:
       [B] if ({staff::moderators::*}, {staff::helpers::*} or {staff::owners}) contains player's name:[/B]
            message "works" to player
        else:
            message "sad panda :(" to player

Errors on Reload:

code_language.skript:
None.

Console errors:
code_language.skript:
none

Other Useful Info:

Addons using (including versions):
None

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I tired to do it without brackets, but the result was same.
Try adding those 3 lists to a temporary list variable and check if that contains the player. Also the owners variable is not a list variable
 
Status
Not open for further replies.