Solved Please 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 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.

ReportedPlayer

New Member
Mar 5, 2018
6
0
0
Hello,

i have wrote a script. But there ist a problem.

The script:

code_language.skript:
command /strafe [<text>] [<text>] [<text>]:
    aliases: b, s
    permission: ban.ban
    permission message: {@bprefix} &cKeine Rechte!
    trigger:
        if arg-1 is set:
            if arg-2 is not set:
                send "&eVerfügbare Ban ID's &8»"
                send "&a"
                send "&8» &6&l1 &7× &cHACKING &8» &4BAN"
                send "&8» &6&l2 &7× &cVERHALTEN &8» &4BAN"
                send "&8» &6&l3 &7× &cWERBUNG &8» &4CHATBAN"
                send "&8» &6&l4 &7× &cSERVERWERBUNG &8» &4BAN"
                send "&8» &6&l5 &7× &cCHATVERHALTEN &8» &4CHATBAN"
                send "&8» &6&l6 &7× &cSUPPORTAUSNUTZUNG &8» &4BAN"
                send "&8» &6&l7 &7× &cBUGUSING &8» &4CHATBAN"
                send "&8» &6&l8 &7× &cNAMENSGEBUNG &8» &4BAN"
                send "&8» &6&l9 &7× &cBANUMGEHUNG &8» &4BAN"
                send "&a"      
                send "&eDas dürfen nur Spieler ab dem &c&lAdmin &eRang:"
                send "&a"              
                send "&8» &6&l10 &7× &cHAUSVERBOT &8» &4BAN"
                send "&8» &6&l11 &7× &cCHATHAUSVERBOT &8» &4CHATBAN"          
            if arg-2 is "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "10" or "11":
                    if arg-2 is "2":
                        if arg-3 is not set:
                            send "{@bprefix} &6Es muss eine Notiz angegeben werden! &7Benutze &c/ban <Spieler> <ID> <Notiz>"
                            stop                  
                        set {ban.%arg-1%} to true
                        set {grund.%arg-1%} to "Verhalten"
                        set {typ.%arg-1%} to "Ban"      
                        set {Banner} to player                      
                        if {bpkt.%arg-1%} is between 0 and 9:
                            broadcast "hey"
                            set {dauer.%arg-1%} to "1 Tag"
                            add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is between 10 and 19:
                            broadcast "hey"
                            set {dauer.%arg-1%} to "3 Tage"
                            add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is between 20 and 25:
                            broadcast "hey"
                            set {dauer.%arg-1%} to "1 Woche"
                            add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is between 26 and 35:
                            broadcast "hey"
                            set {dauer.%arg-1%} to "1 Monat"
                            add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is more than 35:
                            broadcast "hey"
                            set {dauer.%arg-1%} to "Permanent"
                            add 5 to {bpkt.%arg-1%}
                        add "%arg-1%" to {dauer::*}
                        add 1 to {bananzahl.%arg-1%}
                        set {time.%arg-1%} to now
                        set {_a1} to arg-1 parsed as a player
                        set {id.%arg-1%} to random integer between 1000 and 9999
                        set {id.%{id.%arg-1%}%} to "%arg-1%"
                        loop all players:
                            if loop-player has permission "ban.notify":
                                Send "{@bprefix} &c&lBAN &8┃ %{rang2.%arg-1%}%%arg-1% &8┃ &7%{grund.%arg-1%}% &8┃ &7%{dauer.%arg-1%}% &8┃ %{rang2.%player%}%%player%" to loop-player
                               
                        if arg-3 is set:
                            set {extra.%arg-1%} to "%arg-3%"
                            replace all "&" with "§" in {extra.%arg-1%}
                        else:
                            set {extra.%arg-1%} to "---"
                        set {_a1} to arg-1 parsed as a player                      
                        stop

The problem: The broadcast "hey" is comming two times. Pleas help me.
 
This one is simply
So this part of your code runs
code_language.skript:
if {bpkt.%arg-1%} is between 0 and 9:
                            broadcast "hey"
                            set {dauer.%arg-1%} to "1 Tag"
                            add 5 to {bpkt.%arg-1%}
Which adds 5 to the variable, which in turn makes the next one run, because BOTH are technically true.
So after your "add 5" line, put "stop"
 
I have canged it. But there ist an error.

Here the canged code:

code_language.skript:
                    if arg-2 is "2":
                        if arg-3 is not set:
                            send "{@bprefix} &6Es muss eine Notiz angegeben werden! &7Benutze &c/ban <Spieler> <ID> <Notiz>"
                            stop                   
                        set {ban.%arg-1%} to true
                        set {grund.%arg-1%} to "Verhalten"
                        set {typ.%arg-1%} to "Ban"       
                        set {Banner} to player                       
                        if {bpkt.%arg-1%} is between 0 and 9:
                                                    broadcast "hey"
                                                    set {dauer.%arg-1%} to "1 Tag"
                                                    add 5 to {bpkt.%arg-1%}   
                        if {bpkt.%arg-1%} is between 10 and 19:
                                                    broadcast "hey"
                                                    set {dauer.%arg-1%} to "3 Tag"
                                                    add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is between 20 and 25:
                                                    broadcast "hey"
                                                    set {dauer.%arg-1%} to "7 Tag"
                                                    add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is between 26 and 35:
                                                    broadcast "hey"
                                                    set {dauer.%arg-1%} to "14 Tag"
                                                    add 5 to {bpkt.%arg-1%}
                        if {bpkt.%arg-1%} is more than 36:
                                                    broadcast "hey"
                                                    set {dauer.%arg-1%} to "Permanent"
                                                    add 5 to {bpkt.%arg-1%}
                        add "%arg-1%" to {dauer::*}
                        add 1 to {bananzahl.%arg-1%}
                        set {time.%arg-1%} to now
                        set {_a1} to arg-1 parsed as a player
                        set {id.%arg-1%} to random integer between 1000 and 9999
                        set {id.%{id.%arg-1%}%} to "%arg-1%"
                        loop all players:
                            if loop-player has permission "ban.notify":
                                Send "{@bprefix} &c&lBAN &8┃ %{rang2.%arg-1%}%%arg-1% &8┃ &7%{grund.%arg-1%}% &8┃ &7%({dauer.%arg-1%}/24)% Tag/e &8(&7%{dauer.%arg-1%}% Stunde/n&r&8) &8┃ %{rang2.%player%}%%player%" to loop-player
                                
                        if arg-3 is set:
                            set {extra.%arg-1%} to "%arg-3%"
                            replace all "&" with "§" in {extra.%arg-1%}
                        else:
                            set {extra.%arg-1%} to "---"
                        set {_a1} to arg-1 parsed as a player                       
                        kick {_a1} due to "&b&m+-----------------&r&b+ %nl%%nl% &3&l&nGamingMine&f%nl%%nl% &7Du wurdest von &aGamingMine.de &c&lgebannt!%nl%&7%nl%&7Grund: &6%{grund.%arg-1%}% &8(&eID: %{id.%arg-1%}%&8)%nl%%nl%&b&m+-----------------&r&b+"
                        stop

The error:

Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (SpigotSystem.sk, line 124: if {bpkt.%arg-1%} is between 10 and 19:')
 
Just like the error says you need to fix your indentation
The first code you posted was spaces great
This last one you have too many indents
 
Status
Not open for further replies.