Solved Toggle players

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

bobby

Active Member
Jan 28, 2017
61
0
6
26
Hey, I'm wondering how could I make it so on /togglep it will toggle all players(remove all players from the player who ran the command) except people that have the perm "toggle.bypass.player" I'm using 1.10.2 MC.
 
You could do this
code_language.skript:
command /togglep:
    trigger:
        if {togglep.%player%} is not set:
            set {togglep.%player%} to "true"
            wait 1 tick
        if {togglep.%player%} is "true":
            set {togglep.%player%} to "false"
            send "&cHiding players" to player
            loop all players:
                if loop-player doesn't have permission "toggle.bypass.player":
                    hide loop-player from player
                    stop
        if {togglep.%player%} is "false":
            set {togglep.%player%} to "true"
            send "&aRevealing players" to player
            reveal all players to player
[doublepost=1505691374,1505616827][/doublepost]Glad i could help :emoji_slight_smile:
 
  • Like
Reactions: bobby
You could do this
code_language.skript:
command /togglep:
    trigger:
        if {togglep.%player%} is not set:
            set {togglep.%player%} to "true"
            wait 1 tick
        if {togglep.%player%} is "true":
            set {togglep.%player%} to "false"
            send "&cHiding players" to player
            loop all players:
                if loop-player doesn't have permission "toggle.bypass.player":
                    hide loop-player from player
                    stop
        if {togglep.%player%} is "false":
            set {togglep.%player%} to "true"
            send "&aRevealing players" to player
            reveal all players to player
[doublepost=1505691374,1505616827][/doublepost]Glad i could help :emoji_slight_smile:
Why put booleans in text............? Please remove the quotes.