Unban doesn't work, formatting broken. HELP!!!!

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

Jacob105

Member
Aug 7, 2020
48
1
8
24
Unban prints a usage message, kick is broken, ban is broken, spaces are annoying, HOW DO I FIX THIS!!!!!!!!

Code:
command /ban [<offline player>] [<text>]:
    aliases: nitrogen:ban, nitrogen:b, b
    trigger:
        if executor does not have permission "punishments.ban":
            send "&cYou do not have permission to execute this command!"
        else if arg-1 is not set:
            send "&cUsage: /ban <player> [-s] [reason] [-s]"
        else if arg-2 is not set:
            if arg-1 has played before:
                send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
                send "&7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a." to all players
                kick arg-1 due to "&cYou were permanently banned from Nitrolands."
                set {banned::%arg-1%} to true
            else if arg-1 is online:
                send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
                send "&7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a." to all players
                kick arg-1 due to "&cYou were permanently banned from Nitrolands."
                set {banned::%arg-1%} to true          
            else:
                send "&cError: No player matching &e%arg-1%&c has connected to the network."
        else:
            set {_arg2} to uncolored arg-2
            if {_arg2} is "-s", " -s" or "-s ":
                replace all "-s", " -s" and "-s " in {_arg2} with ""
                if arg-1 has played before:
                    send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
                    send "&7(Silent) &7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a." to all players where [input has permission "staff.bans.see"]
                    kick arg-1 due to "&cYou were permanently banned from Nitrolands."
                    set {banned::%arg-1%} to true
                else if arg-1 is online:
                    send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
                    send "&7(Silent) &7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a." to all players where [input has permission "staff.bans.see"]
                    kick arg-1 due to "&cYou were permanently banned from Nitrolands."
                    set {banned::%arg-1%} to true
                else:
                    send "&cError: No player matching &e%arg-1%&c has connected to the network."
            else if {_arg2} isn't "-s", " -s" or "-s ":
                if {_arg2} contains "-s", " -s" or "-s ":
                    replace all "-s", " -s" and "-s " in {_arg2} with ""
                    if arg-1 has played before:
                        set {banned::%arg-1%} to true
                        set {banned::%arg-1%::reason} to uncolored {_arg2}        
                        send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
                        send "&7(Silent) &7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{_arg2}%&a." to all players where [input has permission "staff.bans.see"]          
                        kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"
                    else if arg-1 is online:
                        set {banned::%arg-1%} to true
                        set {banned::%arg-1%::reason} to uncolored {_arg2}
                        send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
                        send "&7(Silent) &7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{_arg2}%&a." to all players where [input has permission "staff.bans.see"]  
                        kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"      
                    else:
                        send "&cError: No player matching &e%arg-1%&c has connected to the network."
                else:
                    if arg-1 has played before:
                        set {banned::%arg-1%} to true
                        set {banned::%arg-1%::reason} to uncolored {_arg2}
                        send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
                        send "&7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{_arg2}%&a." to all players
                        kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"
                    else if arg-1 is online:
                        set {banned::%arg-1%} to true
                        set {banned::%arg-1%::reason} to uncolored {_arg2}
                        send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
                        send "&7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{_arg2}%&a." to all players
                        kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"            
                    else:
                        send "&cError: No player matching &e%arg-1%&c has connected to the network."

command /fix:
    aliases: nitrogen:repair, nitrogen:fix, repair
    trigger:
        if executor does not have permission "fix.use":
            send "&cYou do not have permission to execute this command!"
        else:
            repair player's tool
            send "&aYour item &e%player's tool%&a has been repaired!"

command /unban [<player>] [<text>]:
    aliases: nitrogen:unban, nitrogen:ub, ub
    trigger:
        if executor does not have permission "punishments.unban":
            send "&cYou do not have permission to execute this command!"
        else if arg-1 is not set:
            send "&cUsage: /unban <player> [-s] [reason] [-s]"
        else if arg-2 is not set:
            if {banned::%arg-1%} is set:
                send "&aYou unbanned %arg-1%%arg-1's displayname%&a."
                send "&7%player's prefix%%player's displayname% &ahas unbanned &7%arg-1's prefix%%arg-1's displayname%&a." to all players
                delete {banned::%arg-1%}
                if {banned::%arg-1%::reason} is set:
                    delete {banned::%arg-1%::reason}
            else:
                send "&cError: No player matching &e%arg-1%&c is banned from the network."
        else:
            set {_arg2} to uncolored arg-2
            if {_arg2} is "-s":
                if {banned::%arg-1%} is set:
                    send "&7(Silent) &aYou unbanned %arg-1's prefix%%arg-1's displayname%&a."
                    send "&7(Silent) &7%player's prefix%%player's displayname% &ahas unbanned &7%arg-1's prefix%%arg-1's displayname%&a." to all players where [input has permission "staff.unbans.see"]
                    delete {banned::%arg-1%}
                    if {banned::%arg-1%::reason} is set:
                        delete {banned::%arg-1%::reason}
                else:
                    send "&cError: No player matching &e%arg-1%&c is banned from the network."  
            else if {_arg2} contains " -s", "-s " or "-s":
                replace all "-s", " -s" and "-s " in {_arg2} with ""
                if {banned::%arg-1%} is set:
                    delete {banned::%arg-1%}
                    if {banned::%arg-1%::reason} is set:
                        delete {banned::%arg-1%::reason}
                    send "&7(Silent) &aYou unbanned %arg-1's prefix%%arg-1's displayname%&a for: &f%{_arg2}%&a."
                    send "&7(Silent) &7%player's prefix%%player's displayname% &ahas unbanned &7%arg-1's prefix%%arg-1's displayname% &afor: &f%{_arg2}%&a." to all players where [input has permission "staff.unbans.see"]
                else:
                    send "&cError: No player matching &e%arg-1%&c is banned from the network."  
            else:
                if {banned::%arg-1%} is set:
                    delete {banned::%arg-1%}
                    if {banned::%arg-1%::reason} is set:
                        delete {banned::%arg-1%::reason}
                    set {unbanned::%arg-1%::reason} to uncolored arg-2
                    send "&aYou unbanned %arg-1's prefix%%arg-1's displayname%&a for: &f%{unbanned::%arg-1%::reason}%&a."
                    send "&7%player's prefix%%player's displayname% &ahas unbanned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%uncolored arg-2%&a." to all players
                else:
                    send "&cError: No player matching &e%arg-1%&c is banned from the network."    

on connect:
    if {banned::%player%} is set:
        if {banned::%player%::reason} is set:
            kick player due to "&cYou were permanently banned from Nitrolands for: %{banned::%player%::reason}%."
        else:
            kick player due to "&cYou were permanently banned from Nitrolands."

Addons using (including versions):
skRayFall v1.8, BoringSK v2.0, skDragon v0.17, SkriptJSON v1.0.0, Skellett v1.9.11, Tablisknu v1.0 (aka. BrokenSK)

Skript Version: Skript 2.6.1
Skript Author: Matocolotoe
Minecraft Version: 1.8.9
No skript errors or console errors.
Have you tried searching the docs?
Yes (oh lord too much)
Have you tried searching the forums? Yes (too much)
What other methods have you tried to fix it? I've asked a friend what to do, and they don't know. I tried adding exceptions like extra checks and they don't work.
 
Status
Not open for further replies.