Solved Wanted Level /jail won't work

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

Tadass

New Member
Jul 17, 2018
7
1
0
27
Hi.
So i created wanted level skript and i want to make if player has 40 wanted level automatically jail him
sry bad at english

skript:
code_language.skript:
command /wanted [<player>]:
    trigger:
        if arg 1 is not set:
            message "&fUse: &b- /wanted [player]"
        if arg 1 is set:
            message "&fHe &b%arg 1% &fhave &b%{wantedlevel.%arg 1%}% &fwanted level!"
        if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
        if {wantedlevel.%attacker%} is 40: # Problem is here
            execute console command "/jail %player% jail 10"
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
                    if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0

error says expected 12 spaces, but found 20 spaces line 15, cannot use 'attacker' outside of a damage/death/destroy event line 9
 
Last edited:
code_language.skript:
if {wantedlevel.%attacker%} is 40:
to
code_language.skript:
if {wantedlevel.%player%} is 40:

Fix spaces
 
  • Like
Reactions: Tadass
change this:
code_language.skript:
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
                    if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
to this
code_language.skript:
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
            if {wantedlevel.%arg 1%} is not set:
                set {wantedlevel.%arg 1%} to 0
and arg-1 needs to be either attacker or victim, im not sure which one it was
 
change this:
code_language.skript:
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
                    if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
to this
code_language.skript:
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
            if {wantedlevel.%arg 1%} is not set:
                set {wantedlevel.%arg 1%} to 0
and arg-1 needs to be either attacker or victim, im not sure which one it was
thanks now the second bad thing is that i want to make if player has 52 wanted level then jail him
i tried do like that:

code_language.skript:
command /wantedlvl [<player>]:
    trigger:
        if arg 1 is not set:
            message "&fUse: &b- /wantedlvl [nick]"
        if arg 1 is set:
            message "&b%arg 1% &fhas &b%{wantedlevel.%arg 1%}% &fwanted level!"
        if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
        if {wantedlevel.%player%} is 52
        execute console command "/jail %player% jailname 10"

But then says: 'if {wantedlevel.%player%}' is not an entity type

and tried to put ur that skript and add
code_language.skript:
       if {wantedlevel.%player%} is 52
        execute console command "/jail %player% jailname 10

still nothing but spaces fixed
but jail command not works
 
thanks now the second bad thing is that i want to make if player has 52 wanted level then jail him
i tried do like that:

code_language.skript:
command /wantedlvl [<player>]:
    trigger:
        if arg 1 is not set:
            message "&fUse: &b- /wantedlvl [nick]"
        if arg 1 is set:
            message "&b%arg 1% &fhas &b%{wantedlevel.%arg 1%}% &fwanted level!"
        if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
        if {wantedlevel.%player%} is 52
        execute console command "/jail %player% jailname 10"

But then says: 'if {wantedlevel.%player%}' is not an entity type

and tried to put ur that skript and add
code_language.skript:
       if {wantedlevel.%player%} is 52
        execute console command "/jail %player% jailname 10

still nothing but spaces fixed
but jail command not works



You forgot the ":" after "if {wantedlevel.%player%} is 52"
 
actually I just realized the problem there is, if you are always adding 10 to that variable, it will never equal 52, so do this instead
code_language.skript:
if {wantedlevel.%player%} >= 52:
    execute console command "jail %player% jailname 10"
 
  • Like
Reactions: Tadass
actually I just realized the problem there is, if you are always adding 10 to that variable, it will never equal 52, so do this instead
code_language.skript:
if {wantedlevel.%player%} >= 52:
    execute console command "jail %player% jailname 10"
error: expected 16 spaces, but found '->->______' [-> = tab, _ = space, ? = other whitespace] line 15: {wantedlevel.%arg 1%} >= 52:


code_language.skript:
command /wantedlvl [<player>]:
    trigger:
        if arg 1 is not set:
            message "&fUse: &b- /wantedlvl [nick]"
        if arg 1 is set:
            message "&b%arg 1% &fhas &b%{wantedlevel.%arg 1%}% &fwanted level!"
        if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
            if {wantedlevel.%arg 1%} is not set:
                set {wantedlevel.%arg 1%} to 0
                if {wantedlevel.%player%} >= 52:
                execute console command "/jail %arg 1% jailname 10"
 
Last edited:
error: expected 16 spaces, but found '->->______' [-> = tab, _ = space, ? = other whitespace] line 15: {wantedlevel.%arg 1%} >= 52:


code_language.skript:
command /wantedlvl [<player>]:
    trigger:
        if arg 1 is not set:
            message "&fUse: &b- /wantedlvl [nick]"
        if arg 1 is set:
            message "&b%arg 1% &fhas &b%{wantedlevel.%arg 1%}% &fwanted level!"
        if {wantedlevel.%arg 1%} is not set:
            set {wantedlevel.%arg 1%} to 0
on death:
    victim is a player:
        attacker is a player:
            add 10 to {wantedlevel.%attacker%}
                if {wantedlevel.%player%} >= 52:
                execute console command "/jail %arg 1% jailname 10"
then change your tabs to spaces or spaces to tabs
Thank you so much now it works perfectly :emoji_slight_smile:
 
  • Like
Reactions: ShaneBee
Awesome, you're welcome, glad I could help
[doublepost=1531948725,1531941363][/doublepost]Also... make sure to click best answer to mark this thread as solved
 
Status
Not open for further replies.