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