I'm trying to make a countdown when the RadiusBrick is touched.

NumValue = script.Parent.Value.Value
Countdown = script.Parent.Countdown.Value

RadiusBrick = script.Parent.RadiusBrick

RadiusBrick.Touched:connect(function(otherPart)
	if NumValue == 1 and otherPart.Parent:FindFirstChild("Humanoid") ~= nil then
		NumValue = 2
		repeat
			Countdown = Countdown + 1
			wait(1)
		until
		RadiusBrick.TouchEnded or Countdown = 10
	else
	end
end)

RadiusBrick.TouchEnded:connect(function()
	NumValue = 1
	repeat
	Countdown = Countdown - 1
	wait(1)
	until
	RadiusBrick.Touched or Countdown = 0
end)

In both repeat's a red line shows under the = sign after the until .

Could someone tell me why this happens and/or how I fix this?

Thanks.

1 comment