#condition not working

1 messages · Page 1 of 1 (latest)

crisp spade
#
on death:
    if victim is player:
        if lore of attacker's tool contains "&cRaise the Dead":
            set line 2 of lore of attacker's tool to "&lDire Soul "
            
on right click:
    if lore of player's tool contains "&lDire Soul":
    set line 2 of lore of player's tool to ""
    wait 17 ticks
    play sound "entity.ender_dragon.ambient" with pitch 1 to all players
    spawn zombie at location of player
    set {_item} to netherite helmet of mending
    set {_item1} to leather tunic of mending
    set {_item2} to leather pants of mending
    set {_item3} to leather boots of mending
    set {_item4} to netherite sword of sharpness 85
    dye {_item} red
    dye {_item1} red
    dye {_item2} red
    dye {_item3} red
    add unbreaking 255 to {_item}
    add unbreaking 255 to {_item1}
    add unbreaking 255 to {_item2}
    add unbreaking 255 to {_item3}
    add unbreaking 255 to {_item4}
    set the last spawned zombie's attack damage attribute to 10
    equip last spawned zombie with {_item} 
    equip last spawned zombie with {_item1}
    equip last spawned zombie with {_item2}
    equip last spawned zombie with {_item3} 
    set last spawned zombie's held item to {_item4}
    set last spawned zombie's max health to 10000
    set last spawned zombie's health to 10000
    set display name of last spawned zombie to "&c&lTHE AWAKENED" 
on death:
    if victim's name is "&c&lTHE AWAKENED"
    clear drops 
    ```
everytime you right click regardless of item lore it will spawn the zombie can anyone help fix
hidden sinew
#

!indent

bold dirgeBOT
#

Indentation in Skript

In skript, you need to maintain consistent indentation, meaning you cannot indent 1 line 5 spaces, and the next 7 spaces. Usually it’s recommended you use tabs, however.

A good rule of thumb is to always indent the subsequent line whenever the previous statement ends with a :, an exception to this is in command statements with items before the trigger such as permission: or aliases:

With conditional statements and loops, any code that is indented within the statement will be run as a part of the statement, other code will not be run within the statement. Here is an example of proper indentation:

crisp spade
#
  on right click:
        if lore of player's tool contains "&lDire Soul":
            set line 2 of lore of player's tool to ""
            wait 17 ticks
            play sound "entity.ender_dragon.ambient" with pitch 1 to all players
            spawn zombie at location of player
            set {_item} to netherite helmet of mending
            set {_item1} to leather tunic of mending
            set {_item2} to leather pants of mending
            set {_item3} to leather boots of mending
            set {_item4} to netherite sword of sharpness 85
            dye {_item} red
            dye {_item1} red
            dye {_item2} red
            dye {_item3} red
            add unbreaking 255 to {_item}
            add unbreaking 255 to {_item1}
            add unbreaking 255 to {_item2}
            add unbreaking 255 to {_item3}
            add unbreaking 255 to {_item4}
            set the last spawned zombie's attack damage attribute to 10
            equip last spawned zombie with {_item} 
            equip last spawned zombie with {_item1}
            equip last spawned zombie with {_item2}
            equip last spawned zombie with {_item3} 
            set last spawned zombie's held item to {_item4}
            set last spawned zombie's max health to 10000
            set last spawned zombie's health to 10000
            set display name of last spawned zombie to "&c&lTHE AWAKENED" 
#

the on right click is idented

shrewd elm
#

do /sk info and send output

crisp spade
#

/sk info

shrewd elm
#

...

hidden sinew
#

:)))

crisp spade
hidden sinew
#

skript info

#

sk for short

shrewd elm
#

i am at a loss for words

#

run the command /sk info in game or sk info in console

#

screenshot the output and post it here

#

congrats, youre the first person i have ever had to explain that to

crisp spade
crisp spade
#

ok*

shrewd elm
crisp spade
shrewd elm
#

restart your server and look in console/logs

hidden sinew
crisp spade
shrewd elm
#

dont

hidden sinew
#

either way should be neither

shrewd elm
#

why would you indent before an event

#

i didnt even think to check because why

hidden sinew
#

you gotta check when they dont know what /sk info is

shrewd elm
#

fr

crisp spade
#

it doesnt work

hidden sinew
#

error?

shrewd elm
#

show updated code

crisp spade
#
on death:
    if victim is player:
        if lore of attacker's tool contains "&cRaise the Dead":
            set line 2 of lore of attacker's tool to "&4Dire Soul "
            
on right click:
    if lore of player's tool contains "&4Dire Soul":
        set line 2 of lore of player's tool to ""
        wait 17 ticks
        play sound "entity.ender_dragon.ambient" with pitch 1 to all players
        spawn zombie at location of player
        set {_item} to netherite helmet of mending
        set {_item1} to leather tunic of mending
        set {_item2} to leather pants of mending
        set {_item3} to leather boots of mending
        set {_item4} to netherite sword of sharpness 85
        dye {_item} red
        dye {_item1} red
        dye {_item2} red
        dye {_item3} red
        add unbreaking 255 to {_item}
        add unbreaking 255 to {_item1}
        add unbreaking 255 to {_item2}
        add unbreaking 255 to {_item3}
        add unbreaking 255 to {_item4}
        set the last spawned zombie's attack damage attribute to 10
        equip last spawned zombie with {_item} 
        equip last spawned zombie with {_item1}
        equip last spawned zombie with {_item2}
        equip last spawned zombie with {_item3} 
        set last spawned zombie's held item to {_item4}
        set last spawned zombie's max health to 10000
        set last spawned zombie's health to 10000
        set display name of last spawned zombie to "&c&lTHE AWAKENED" 
on death:
    if victim's name is "&c&lTHE AWAKENED"
    clear drops 
    ```
#

the on right click doesnt work at all

hidden sinew
#

errors?

crisp spade
hidden sinew
#

you should start using uncolored name/lore

crisp spade
#

would that fix the error

#

i mean the error doesnt matter since it works regardless, but the main error is the on right click not working at all

forest forge
#

or if colored victim's name is

hidden sinew
#

prob, not but would fix so you dont need to type the exact colors

hidden sinew
forest forge
#

&c isn't that a color?

hidden sinew
#

sure is

forest forge
#

so

hidden sinew
#

but why would you check the colors?

forest forge
#

somtimes that fix the error

hidden sinew
#

when you can check only the name

forest forge
#

idk it worked on my skript

crisp spade
#

the line 36 error doesnt affect anything

#

the on right click ability is the main issue

#

it doesnt work at all

hidden sinew
#

so add uncolored lore

#

and remove the colors from the if lore ...

#

so it will only be the lore name

crisp spade
#

its uncolored now and it still doesnt work

hidden sinew
#

show code

forest forge
#

try

lore of tool contains "&4Dire Soul"

instead of

if lore of player's tool contains "&4Dire Soul":

and remove 1 tab from all lines underneed

forest forge
#

this could work

#

cause name works

#

sorry i didn't fullt edited it

crisp spade
#

doesnt work

forest forge
#

show code

crisp spade
#
on death:
    if victim is player:
        if lore of attacker's tool contains "&cRaise the Dead":
            set line 2 of lore of attacker's tool to "&4Dire Soul"
            
on right click:
    lore of tool is "&4Dire Soul":
        set line 2 of lore of player's tool to ""
        wait 17 ticks
        play sound "entity.ender_dragon.ambient" with pitch 1 to all players
        spawn zombie at location of player
        set {_item} to netherite helmet of mending
        set {_item1} to leather tunic of mending
        set {_item2} to leather pants of mending
        set {_item3} to leather boots of mending
        set {_item4} to netherite sword of sharpness 85
        dye {_item} red
        dye {_item1} red
        dye {_item2} red
        dye {_item3} red
        add unbreaking 255 to {_item}
        add unbreaking 255 to {_item1}
        add unbreaking 255 to {_item2}
        add unbreaking 255 to {_item3}
        add unbreaking 255 to {_item4}
        set the last spawned zombie's attack damage attribute to 10
        equip last spawned zombie with {_item} 
        equip last spawned zombie with {_item1}
        equip last spawned zombie with {_item2}
        equip last spawned zombie with {_item3} 
        set last spawned zombie's held item to {_item4}
        set last spawned zombie's max health to 10000
        set last spawned zombie's health to 10000
        set display name of last spawned zombie to "&c&lTHE AWAKENED" 
on death:
    if victim's name is "&c&lTHE AWAKENED"
    clear drops 
    ```
shrewd elm
#

indent

forest forge
#
on death:
    if victim is player:
        if lore of attacker's tool contains "&cRaise the Dead":
            set line 2 of lore of attacker's tool to "&4Dire Soul"
            
on right click:
    lore of tool contains "&4Dire Soul"
    set line 2 of lore of player's tool to ""
    wait 17 ticks
    play sound "entity.ender_dragon.ambient" with pitch 1 to all players
    spawn zombie at location of player
    set {_item} to netherite helmet of mending
    set {_item1} to leather tunic of mending
    set {_item2} to leather pants of mending
    set {_item3} to leather boots of mending
    set {_item4} to netherite sword of sharpness 85
    dye {_item} red
    dye {_item1} red
    dye {_item2} red
    dye {_item3} red
    add unbreaking 255 to {_item}
    add unbreaking 255 to {_item1}
    add unbreaking 255 to {_item2}
    add unbreaking 255 to {_item3}
    add unbreaking 255 to {_item4}
    set the last spawned zombie's attack damage attribute to 10
    equip last spawned zombie with {_item} 
    equip last spawned zombie with {_item1}
    equip last spawned zombie with {_item2}
    equip last spawned zombie with {_item3} 
    set last spawned zombie's held item to {_item4}
    set last spawned zombie's max health to 10000
    set last spawned zombie's health to 10000
    set display name of last spawned zombie to "&c&lTHE AWAKENED" 
on death:
    if victim's name is "&c&lTHE AWAKENED"
    clear drops 
#

fixed

#

try now

crisp spade
#

cap

shrewd elm
#

not fixed

#

indent

crisp spade
#

lOL

hidden sinew
crisp spade
#

lemme test

hidden sinew
#

and it wont change anything

forest forge
#

now it should work

shrewd elm
#

nope

hidden sinew
#

nope

shrewd elm
#

XD

hidden sinew
#

you did not change anything other then removing if

forest forge
#

i made indents right

hidden sinew
#

it was "right" before removing the if

forest forge
#

ok

shrewd elm
#

you still havent

crisp spade
#

ok anyone know like the issue

shrewd elm
#

yes

hidden sinew
crisp spade
hidden sinew
#

it means that you dont have to worry about forgetting to add &c&l and all that

#

s o you can only check the lore "Dark souls" or whatever

crisp spade
#

how check uncolored lore

hidden sinew
#

uncolored lore of player's tool contains "Dire Soul"

crisp spade
#

would i put this on the right click event

hidden sinew
#

you put it where you would put it

#

replace the other lore of player ..

crisp spade
#

dam n it works

#

GOD DAMN

hidden sinew
#

ofc

#

so never listen to @forest forge

crisp spade
#

wait i put it before the if lore of player's tool contains "&4Dire Soul":

#

is that fine

#

or does it go after

hidden sinew
#

replace

forest forge
hidden sinew
#

you will learn skript one day

crisp spade
#

ok it works perfectly thanks

hidden sinew
#

np