I want to stop a repeat until loop when a condition is met.
script:
game.ReplicatedStorage.events.test.OnServerEvent:Connect(function(player, trigger)
if trigger == "Holding" then
repeat
wait(1)
player.Character:FindFirstChild("Humanoid"):TakeDamage(2)
until
trigger == "NotHolding"
-- i want to stop the loop here, so the player stops taking damage
end
end)