Solved Double loop

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

Delano

Member
Apr 15, 2018
17
2
0
25
So I made this script:
code_language.skript:
every second:
    loop all players:
        if distance between loop-player-1 and {Fura.Spider.Cave.Boss.Encounter} <= 4:
            if {Fura.Spider.Cave.Boss.Conversation.timer.%loop-player-1%} is false:
                set {Fura.Spider.Cave.Boss.Conversation.timer.%loop-player-1%} to true
#------------------------------------------------------------------------------------------------------
                if {Fura.Spider.Cave.Boss.Spawn} is false:
                    set {Fura.Spider.Cave.Boss.Spawn} to true
                    spawn a spider at {Fura.Spider.Cave.Boss.Spawn.Location}
                    wait 1 second
                    loop all entities in radius 20 of loop-player-1:
                        set {Boss.Name::%loop-entity-2%} to "Baeiira"
                        set name of loop-entity-2 to "&7[&5Baeiira&7]"
                        set loop-entity-2's max health to 100
                        set loop-entity-2's health to 100
                        apply slowness 2 to loop-entity-2 for 99 minutes
                        exit loop
                if {Fura.Spider.Cave.Boss.Spawn} is true:
                    stop
#------------------------------------------------------------------------------------------------------
                apply slowness 20 to loop-player-1 for 10 seconds
                apply jump boost -20 to loop-player-1 for 10 seconds
                wait 1 second
                message "&7[&5Baeiira&7] &eI wonder..." to loop-player-1
                wait 3 seconds
                message "&7[&5Baeiira&7] &eWhy would anyone just walk into our den?" to loop-player-1
                wait 3 seconds
                message "&7[&5Baeiira&7] &e1 thing is for sure, we won't let this opportunity go away" to loop-player-1
                wait 3 seconds
                message "&7[&5Baeiira&7] &eWe got fresh meat my children!" to loop-player-1
            if {Fura.Spider.Cave.Boss.Conversation.timer.%loop-player-1%} is true:
                stop

on death:
    {Boss.Name::%entity%} is "Baeiira":
        set {Fura.Spider.Cave.Boss.Spawn} to false

command /timer <text>:
    trigger:
        if arg-1 is "reset":
            set {Fura.Spider.Cave.Boss.Conversation.timer.%player%} to false
            message "&eThe timer has been reset!" to player
        if arg-1 is "test":
            set {Fura.Spider.Cave.Boss.Spawn} to false
            message "&eDone!" to player

At first when the lines between the #----- weren't there and loop-player-1 was loop-player everything worked fine.
now with the lines between the #---- nothing works anymore and I have no clue what it is..

don't mind the text btw, it's for rp purposes
 
wym by nothing works, errors? are you aware that the stop on line 19 will stop the loop, is that intentional?
 
ow .. I noticed at line 8 that it sets it instantly to true so at line 18 it stops
now line 8 is on the end of the loop so the loop runs until the end.
only problem is I get slowness 2 while the max health and health of the spider is set to 100..
and the last section under the #--- isn't triggering
 
if {Fura.Spider.Cave.Boss.Spawn} is true that part wont trigger since youre stopping
 
Status
Not open for further replies.