Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to skip lines of code?

Asked by 10 years ago

I have a bunch of repeat ifs and I want to skip the other repeat ifs if the outcome is different to what the if says. Not sure how to to this perhaps use subroutines if you can in lua, not sure.

            repeat if game.Players.I2.humanoid.health == 0 then
                F.Torso.Position = Are7
                end
            until F.Torso.Position == Are7
            repeat if game.Players.I2.humanoid.health == 0 then
                F.Torso.Position = Are7
                end
            until F.Torso.Position == Are7
            repeat if game.Players.I3.humanoid.health == 0 then
                F.Torso.Position = Are8
                end
            until F.Torso.Position == Are8  
end

So I want to add and else after the if and then refer to later in the code.

3
Humanoid and Health should be capitalized. Merely 2122 — 10y
1
Also, would you please explain what you are trying to do with the script? Merely 2122 — 10y
0
I am trying to make it so that if F dies the game finishes, but if he kills I2, ect he is teleported to the next I(num) in the list. So basically if F dies all others die too and the script restarts Dstructiod 0 — 10y
0
Don't worry added an elseif into the repeat Dstructiod 0 — 10y

Answer this question