Solved Custom reasons banning bug

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

07L

Member
Feb 23, 2019
43
0
0
23
Im using litebans and skript. I made a punish GUI and added a custom reason section. But when you type "permanent" and then the reasons it displays "false <reason>".
Code:
command /customban [<offline player>]:
    trigger:
        if player has permission "exige.punish":
            if arg-1 is set:
                if arg-1 has played before:
                    set {customtime.%player%} to true
                    send message "{@prefix} How long should the user be banned for? (type 'permanent' for a permanent ban)"
                    set {custombanuser.%player%} to arg-1
                else:
                    send message "{@prefix} &cThat player has never played before!"
            else:
                send message "{@prefix} &cYou need to specify a player to punish!"
        else:
            send message "Unknown Command."

on Chat:
    if {customtime.%player%} is true:
        cancel event
        set {custombantime.%player%} to message
        set {customtime.%player%} to false
        set {customban.%player%} to true
        send message "{@prefix} What is the reason for the ban?"
        stop
    if {customban.%player%} is true:
        cancel event
        set {custombanreason.%player%} to message
        set {customban.%player%} to false
        if {customtime.%player%} is "permanent":
            make player execute command "ban %{custombanuser.%player%}% %{custombanreason.%player%}%"
        if {customtime.%player%} is not "permanent":
            make player execute command "ban %{custombanuser.%player%}% %{customtime.%player%}% %{custombanreason.%player%}%"

upload_2019-4-19_21-50-26.png

[doublepost=1555710720,1555707030][/doublepost]
Im using litebans and skript. I made a punish GUI and added a custom reason section. But when you type "permanent" and then the reasons it displays "false <reason>".
Code:
command /customban [<offline player>]:
    trigger:
        if player has permission "exige.punish":
            if arg-1 is set:
                if arg-1 has played before:
                    set {customtime.%player%} to true
                    send message "{@prefix} How long should the user be banned for? (type 'permanent' for a permanent ban)"
                    set {custombanuser.%player%} to arg-1
                else:
                    send message "{@prefix} &cThat player has never played before!"
            else:
                send message "{@prefix} &cYou need to specify a player to punish!"
        else:
            send message "Unknown Command."

on Chat:
    if {customtime.%player%} is true:
        cancel event
        set {custombantime.%player%} to message
        set {customtime.%player%} to false
        set {customban.%player%} to true
        send message "{@prefix} What is the reason for the ban?"
        stop
    if {customban.%player%} is true:
        cancel event
        set {custombanreason.%player%} to message
        set {customban.%player%} to false
        if {customtime.%player%} is "permanent":
            make player execute command "ban %{custombanuser.%player%}% %{custombanreason.%player%}%"
        if {customtime.%player%} is not "permanent":
            make player execute command "ban %{custombanuser.%player%}% %{customtime.%player%}% %{custombanreason.%player%}%"

upload_2019-4-19_21-50-26.png
Nevermind I found the error ^-^
 
Status
Not open for further replies.