Can somebody help me with this skript?

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

Status
Not open for further replies.

KroterPvP

Active Member
Apr 10, 2017
178
7
18
I want it to loop players. Then, kick the players without permission and keep the ones who have permission. But it doesn't do it because the executor has the permission, so it doesn't read the other part of the code. Any ideas?
code_language.skript:
command /kickall [<text>]:
    trigger:
        player has permission "sb.kickall":
            if arg 1 is set:
                loop all players:
                    if loop-player has permission "sb.kickall.exempt":
                        stop
                        if loop-player has permission "sb.kickall.notify":
                            send "&8[&c&lBANS&8] &a%player% &7has kicked all players." to loop-player
                            send "&7Reason: &c%arg 1%&7." to loop-player
                    if loop-player doesn't have permission "sb.kickall.exempt":
                        set {kickall} to loop-player
                        kick {kickall} due to "&7Sadly, you were &cKicked &7from &6ServerName&7. Apply on our forums if you want to dispute your kick!%nl%%nl%&7Kicked by: &a%{kickedby.%arg 1%}%%nl%&7Reason: &c%{kick.reason.%arg 1%}%%nl%%nl%&eVisit our shop &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net"
            else if arg 1 is not set:
                send "&8[&c&lBANS&8] &7You must use &a/kickall <reason>&7."
        else if player doesn't have permission "sb.kickall":
            send "&8[&c&lBANS&8] &cYou don't have permission to do this!"
 
Line 7 is unnecessary and causes it to stop looping as soon as it finds one person who has the perm so just get rid of it and this should work
code_language.skript:
command /kickall [<text>]:
    trigger:
        player has permission "sb.kickall":
            if arg 1 is set:
                loop all players:
                    if loop-player has permission "sb.kickall.exempt":
                        if loop-player has permission "sb.kickall.notify":
                            send "&8[&c&lBANS&8] &a%player% &7has kicked all players." to loop-player
                            send "&7Reason: &c%arg 1%&7." to loop-player
                    if loop-player doesn't have permission "sb.kickall.exempt":
                        set {kickall} to loop-player
                        kick {kickall} due to "&7Sadly, you were &cKicked &7from &6ServerName&7. Apply on our forums if you want to dispute your kick!%nl%%nl%&7Kicked by: &a%{kickedby.%arg 1%}%%nl%&7Reason: &c%{kick.reason.%arg 1%}%%nl%%nl%&eVisit our shop &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net"
            else if arg 1 is not set:
                send "&8[&c&lBANS&8] &7You must use &a/kickall <reason>&7."
        else if player doesn't have permission "sb.kickall":
            send "&8[&c&lBANS&8] &cYou don't have permission to do this!"
 
Line 7 is unnecessary and causes it to stop looping as soon as it finds one person who has the perm so just get rid of it and this should work
code_language.skript:
command /kickall [<text>]:
    trigger:
        player has permission "sb.kickall":
            if arg 1 is set:
                loop all players:
                    if loop-player has permission "sb.kickall.exempt":
                        if loop-player has permission "sb.kickall.notify":
                            send "&8[&c&lBANS&8] &a%player% &7has kicked all players." to loop-player
                            send "&7Reason: &c%arg 1%&7." to loop-player
                    if loop-player doesn't have permission "sb.kickall.exempt":
                        set {kickall} to loop-player
                        kick {kickall} due to "&7Sadly, you were &cKicked &7from &6ServerName&7. Apply on our forums if you want to dispute your kick!%nl%%nl%&7Kicked by: &a%{kickedby.%arg 1%}%%nl%&7Reason: &c%{kick.reason.%arg 1%}%%nl%%nl%&eVisit our shop &8» &cwww.yourserver.buycraft.net%nl%&eForums to apply &8» &cwww.yourserver.net"
            else if arg 1 is not set:
                send "&8[&c&lBANS&8] &7You must use &a/kickall <reason>&7."
        else if player doesn't have permission "sb.kickall":
            send "&8[&c&lBANS&8] &cYou don't have permission to do this!"
Okey, I will try this! Thanks
 
Status
Not open for further replies.