Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
NykoVania 231 Moderation Voter
2 years ago
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

Log in to vote
0
Answered by 2 years ago
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.

Ad

Answer this question