1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Skript' started by Jacob105, Mar 6, 2022.

Thread Status:
Not open for further replies.
  1. Jacob105

    Jacob105 Member

    Joined:
    Aug 7, 2020
    Messages:
    48
    Likes Received:
    1
    Unban prints a usage message, kick is broken, ban is broken, spaces are annoying, HOW DO I FIX THIS!!!!!!!!

    Code (Text):
    1. command /ban [<offline player>] [<text>]:
    2.     aliases: nitrogen:ban, nitrogen:b, b
    3.     trigger:
    4.         if executor does not have permission "punishments.ban":
    5.             send "&cYou do not have permission to execute this command!"
    6.         else if arg-1 is not set:
    7.             send "&cUsage: /ban <player> [-s] [reason] [-s]"
    8.         else if arg-2 is not set:
    9.             if arg-1 has played before:
    10.                 send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
    11.                 send "&7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a." to all players
    12.                 kick arg-1 due to "&cYou were permanently banned from Nitrolands."
    13.                 set {banned::%arg-1%} to true
    14.             else if arg-1 is online:
    15.                 send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
    16.                 send "&7%player's prefix%%player's displayname% &ahas permanently banned &7%arg-1's prefix%%arg-1's displayname%&a." to all players
    17.                 kick arg-1 due to "&cYou were permanently banned from Nitrolands."
    18.                 set {banned::%arg-1%} to true          
    19.             else:
    20.                 send "&cError: No player matching &e%arg-1%&c has connected to the network."
    21.         else:
    22.             set {_arg2} to uncolored arg-2
    23.             if {_arg2} is "-s", " -s" or "-s ":
    24.                 replace all "-s", " -s" and "-s " in {_arg2} with ""
    25.                 if arg-1 has played before:
    26.                     send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
    27.                     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"]
    28.                     kick arg-1 due to "&cYou were permanently banned from Nitrolands."
    29.                     set {banned::%arg-1%} to true
    30.                 else if arg-1 is online:
    31.                     send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a."
    32.                     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"]
    33.                     kick arg-1 due to "&cYou were permanently banned from Nitrolands."
    34.                     set {banned::%arg-1%} to true
    35.                 else:
    36.                     send "&cError: No player matching &e%arg-1%&c has connected to the network."
    37.             else if {_arg2} isn't "-s", " -s" or "-s ":
    38.                 if {_arg2} contains "-s", " -s" or "-s ":
    39.                     replace all "-s", " -s" and "-s " in {_arg2} with ""
    40.                     if arg-1 has played before:
    41.                         set {banned::%arg-1%} to true
    42.                         set {banned::%arg-1%::reason} to uncolored {_arg2}        
    43.                         send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
    44.                         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"]          
    45.                         kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"
    46.                     else if arg-1 is online:
    47.                         set {banned::%arg-1%} to true
    48.                         set {banned::%arg-1%::reason} to uncolored {_arg2}
    49.                         send "&7(Silent) &aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
    50.                         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"]  
    51.                         kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"      
    52.                     else:
    53.                         send "&cError: No player matching &e%arg-1%&c has connected to the network."
    54.                 else:
    55.                     if arg-1 has played before:
    56.                         set {banned::%arg-1%} to true
    57.                         set {banned::%arg-1%::reason} to uncolored {_arg2}
    58.                         send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
    59.                         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
    60.                         kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"
    61.                     else if arg-1 is online:
    62.                         set {banned::%arg-1%} to true
    63.                         set {banned::%arg-1%::reason} to uncolored {_arg2}
    64.                         send "&aYou banned &7%arg-1's prefix%%arg-1's displayname%&a for: &f%{banned::%arg-1%::reason}%&a."
    65.                         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
    66.                         kick arg-1 due to "&cYou were permanently banned from Nitrolands for: %{banned::%arg-1%::reason}%"            
    67.                     else:
    68.                         send "&cError: No player matching &e%arg-1%&c has connected to the network."
    69.  
    70. command /fix:
    71.     aliases: nitrogen:repair, nitrogen:fix, repair
    72.     trigger:
    73.         if executor does not have permission "fix.use":
    74.             send "&cYou do not have permission to execute this command!"
    75.         else:
    76.             repair player's tool
    77.             send "&aYour item &e%player's tool%&a has been repaired!"
    78.  
    79. command /unban [<player>] [<text>]:
    80.     aliases: nitrogen:unban, nitrogen:ub, ub
    81.     trigger:
    82.         if executor does not have permission "punishments.unban":
    83.             send "&cYou do not have permission to execute this command!"
    84.         else if arg-1 is not set:
    85.             send "&cUsage: /unban <player> [-s] [reason] [-s]"
    86.         else if arg-2 is not set:
    87.             if {banned::%arg-1%} is set:
    88.                 send "&aYou unbanned %arg-1%%arg-1's displayname%&a."
    89.                 send "&7%player's prefix%%player's displayname% &ahas unbanned &7%arg-1's prefix%%arg-1's displayname%&a." to all players
    90.                 delete {banned::%arg-1%}
    91.                 if {banned::%arg-1%::reason} is set:
    92.                     delete {banned::%arg-1%::reason}
    93.             else:
    94.                 send "&cError: No player matching &e%arg-1%&c is banned from the network."
    95.         else:
    96.             set {_arg2} to uncolored arg-2
    97.             if {_arg2} is "-s":
    98.                 if {banned::%arg-1%} is set:
    99.                     send "&7(Silent) &aYou unbanned %arg-1's prefix%%arg-1's displayname%&a."
    100.                     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"]
    101.                     delete {banned::%arg-1%}
    102.                     if {banned::%arg-1%::reason} is set:
    103.                         delete {banned::%arg-1%::reason}
    104.                 else:
    105.                     send "&cError: No player matching &e%arg-1%&c is banned from the network."  
    106.             else if {_arg2} contains " -s", "-s " or "-s":
    107.                 replace all "-s", " -s" and "-s " in {_arg2} with ""
    108.                 if {banned::%arg-1%} is set:
    109.                     delete {banned::%arg-1%}
    110.                     if {banned::%arg-1%::reason} is set:
    111.                         delete {banned::%arg-1%::reason}
    112.                     send "&7(Silent) &aYou unbanned %arg-1's prefix%%arg-1's displayname%&a for: &f%{_arg2}%&a."
    113.                     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"]
    114.                 else:
    115.                     send "&cError: No player matching &e%arg-1%&c is banned from the network."  
    116.             else:
    117.                 if {banned::%arg-1%} is set:
    118.                     delete {banned::%arg-1%}
    119.                     if {banned::%arg-1%::reason} is set:
    120.                         delete {banned::%arg-1%::reason}
    121.                     set {unbanned::%arg-1%::reason} to uncolored arg-2
    122.                     send "&aYou unbanned %arg-1's prefix%%arg-1's displayname%&a for: &f%{unbanned::%arg-1%::reason}%&a."
    123.                     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
    124.                 else:
    125.                     send "&cError: No player matching &e%arg-1%&c is banned from the network."    
    126.  
    127. on connect:
    128.     if {banned::%player%} is set:
    129.         if {banned::%player%::reason} is set:
    130.             kick player due to "&cYou were permanently banned from Nitrolands for: %{banned::%player%::reason}%."
    131.         else:
    132.             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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...