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

commandmaker

New Member
May 27, 2019
7
0
1
19
i am trying to recreate parts of skyfactory like silkworms and i have tried to do it but i can't get it to work properly

Code:
on right click:
    if {Running} is equal to 1:
        if targeted block is oak leaves:
            if distance between targeted block and player is less than or equal to 5:
                set {SilkStage::%targeted block's position%} to 1

on script load:
    while {Running} is equal to 1:
        wait 1 tick
        loop {SilkStage::*}:
            if {SilkStage::%loop-value%} is greater or equal to 500:
                set block at loop-value to bedrock
                delete {SilkStage::%loop-value%}
            else:
                add 1 to {SilkStage::%loop-value%}

thanks for any help fixing it
 
i am trying to recreate parts of skyfactory like silkworms and i have tried to do it but i can't get it to work properly

Code:
on right click:
    if {Running} is equal to 1:
        if targeted block is oak leaves:
            if distance between targeted block and player is less than or equal to 5:
                set {SilkStage::%targeted block's position%} to 1

on script load:
    while {Running} is equal to 1:
        wait 1 tick
        loop {SilkStage::*}:
            if {SilkStage::%loop-value%} is greater or equal to 500:
                set block at loop-value to bedrock
                delete {SilkStage::%loop-value%}
            else:
                add 1 to {SilkStage::%loop-value%}

thanks for any help fixing it
You have to use `loop-index` for the index
 
but it's fine if it doesn't exist because then it just won't do anything i thought
also can you put changes in it?
 
but it's fine if it doesn't exist because then it just won't do anything i thought
also can you put changes in it?
No I won't fix your code. Use loop-index, not loop-value.
 
Status
Not open for further replies.