Send message to a permission group

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

UwRekening

Member
May 30, 2020
3
0
0
36
Hey, I'm trying to make a war script. and so I have some problems. so if I do /war then if I have the permissions of war.astina and if someone else has the permissions "test1", and then if someone clicks on the skull then I get not only message "test1" but also message as "test2" does anyone know why






Code:
create a gui slot 13 of player with Skull of "xNessuno" parsed as offlineplayer named "&5Myria" with lore "&cKlik  om een oorlog te starten tegen Myria" to run:
            if {test1} is true:
                loop all players:
                    if loop-player have permission "oorlog.astina":
                        send "test2" to loop-player
                    if loop-player have permission "test1":
                        set {test1} to true
                        send "this works" to loop-player
                    if loop-player has permission "test2":
                        set {test2} to true
                        send "this works" to loop-player
                    if loop-player has not permission "test2":
                        send "no perms :/" to loop-player

            if {test2} is true:
                loop all players:
                    if loop-player have permission "oorlog.astina":
                        send "test2" to loop-player
                    if loop-player have permission "test1":
                        set {test1} to true
                        send "this works" to loop-player
                    if loop-player has permission "test2":
                        set {test2} to true
                        send "this works" to loop-player
                    if loop-player has not permission "test2":
                        send "no perms :/" to loop-player
 
Use variables like
Code:
{test::%loop-player%}
and try using
Code:
else if {test2} is true:

In the first part of your code you sent yourself message "test1", then you set {test2} to true, then you tested if {test2} is true (= it was) and because it was, it also sent you the message "test2"
 
see what i want is that there are three permissions permission 1 = test1 permission 2 = test2 and permission 3 = test3 so if someone from test1 clicks on the skull then a message will be sent to test3 message "test1 says hello" and if someone clicks test2 on the skull then a message is sent to test3 message "test2 says hello"



Code:
create a gui slot 13 of player with Skull of "xNessuno" parsed as offlineplayer named "&5Myria" with lore "&cKlik  om een oorlog te starten tegen Myria" to run:

   loop all players:
                if loop-player has permission "test1":
                    send "test" to player
                    set {test::%loop-player's uuid%}
                if loop-player has permission "test2":
                    set {test2} to true
                    if loop-player has permission "oorlog.astina":
                        if {test::%loop-player's uuid%} is true:
                            send "lol" to loop-player
                        if {test2} is true:
                            send "lol2" to loop-player
 
You'll need to have SkPerm for this:
Code:
if contains((permissions of player), "the.permission") is true:
    #do something
The only thing you should change in the code above is "the.permission".
 
Status
Not open for further replies.