Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with cooldown script? No errors in output, value doesn't change.

for i, v in pairs(script.Parent.Cooldowns:GetDescendants()) do
	v.Changed:Connect(function(Change)
		if Change.Value == v.MaxValue then
			repeat
				 v.Value = v.Value - 1
				task.wait(1)
			until v.Value == 0
		end
	end)
end

1 answer

✓ Accepted answer
for i, v in pairs(script.Parent.Cooldowns:GetDescendants()) do
    v.Changed:Connect(function(Change)
        if Change.Value == v.MaxValue then
                 v.Value = v.Value - 1
                task.wait(1)
            repeat
            until v.Value == 0
        end
    end)
end

I think this is the right placement.

This discussion is preserved as it was. New answers, comments, and votes are closed.