Repeat until isnt working correctly

So I made a script to take damage away but if the Until is met it stops but the Break Value is set to true when the player presses a key but it doesn’t break:

local BreakValue = player2.PlayerGui.Struggle.Break

    repeat

    wait(0.1)

    humanoid:TakeDamage(2)

    print("damage")

    until BreakValue.Value == true or humanoid.Health <= 2 or script.Parent.Parent.Transformed.Hit.Value == true or humanoid.Parent.Transformed.Value ~= Color3.new(0,0,0) or script.parent.parent.Humanoid.Health <= 0

It’s probably because Lua, among many other scripting languages, are case-sensitive. Use script.Parent.Parent.Humanoid.Health.

1 Like