Solved Remove the ban message and customize it.

  • 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
Hello, I'm working on a ban skript, but I want the "You are banned from this server! Reason:" message to be removed. Any ideas?

I'm using Skript and SkQuerry (for the %newline% variable).
code_language.skript:
command /aban [<offlineplayer>] [<text>]:
    trigger:
        player has permission "bans.ban":
            if arg 1 is set:
                if arg 1 has played on this server before:
                    if arg 2 is set:
                        set {banned.%arg 1%} to true
                        set {ban.time.%arg 1%} to now
                        set {ban.reason.%arg 1%} to argument-2
                        set {ban.expire.%arg 1%} to "Never"
                        set {ban.bannedby.%arg 1%} to player
                        set {BanIP.%arg 1%} to "False"
                        kick arg 1 due to "&7Banned by: &c%{ban.bannedby.%arg 1%}%%nl%&7Reason: &c%arg 2%%nl%&7Banned on: &c%{ban.time.%arg 1%}%%nl%&7This ban will expire: &c%{ban.expire.%arg 1%}%%nl%&7IPBan: &c%{BanIP.%arg 1%}%"
                        ban arg 1 due to "&7Banned by: &c%{ban.bannedby.%arg 1%}%%nl%&7Reason: &c%arg 2%%nl%&7Banned on: &c%{ban.time.%arg 1%}%%nl%&7This ban will expire: &c%{ban.expire.%arg 1%}%%nl%&7IPBan: &c%{BanIP.%arg 1%}%"
                        loop all players:
                            if loop-player has permission "bans.notify":
                                send "&8[&c&lBANS&8] &c%player% &7banned &c%arg 1%&7!" to loop-player
                                send "&7Reason: &c%arg 2%&7." to loop-player
                    else:
                        send "&7You must use &a/aban <player> <reason>&7."
                else if arg 1 is banned:
                    send "&c%arg 1% &7is already banned."
                else if arg 1 hasn't played on this server before:
                    send "&c%arg 1% &7has never joined."
            else:
                send "&7You must use &a/aban <player> <reason>&7."
        else if player doesn't have permission "bans.ban":
            send "&cYou don't have permission to do this!"
 
What exactly isn't working
When a player is banned and tries to join the default message apears. I want it to disapear, and only the custom message apearing.

I think I have a way to do it. Check on join if the player has his variable on true. It yes, it will kick the player and say the message (the kick message doesnt have a default kick message). But I don't know if this will lagg...
 
Instead of checking on join it would be better to check if the variable is true on connect. I don't see why it would lag.
 
You tried to put first the ban, and the kick?
I have fixed it. I check if the player connects to the server, if the player has the variable {banned%player%} to true, it kicks the player. As the kick message doesn't have a deffault message, I'm using it.
 
Status
Not open for further replies.