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.

4 comments

3

Humanoid and Health should be capitalized.

1

Also, would you please explain what you are trying to do with the script?

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

0

Don't worry added an elseif into the repeat