#Cooldowns

1 messages · Page 1 of 1 (latest)

shut fossil
#

How do I make cooldowns on abilities? If possible can yall recommend me some good cooldown modules. preciate it very much.

ripe coral
#
local cooldown=5
while true do
   cooldown-=1
end
..ability```
ivory pendant
#
local cooldown = Instance.new("NumberValue")
    cooldown.Value = tonumber('5')

local onCooldown = false

local workspace = game:GetService("Workspace") and workspace or workspace

game:GetService("Workspace"):SetAttribute("EfficientCooldown", cooldown.Value)

function coolDown()
    while game:GetService("Workspace") ~= cooldown and not (onCooldown == true) do
        task.delay(0, function()
            wait(1)
        end)
        task.wait(1)

        task.spawn(function()
            game:GetService("Workspace"):SetAttribute("EfficientCooldown", workspace:GetAttribute("EfficientCooldown")-cooldown.Value/5)
        end)
        print(Workspace:GetAttribute("EfficientCooldown"))
        
    end
    
    task.delay(cooldown.Value, function()
        onCooldown = false
    end)

end

Workspace.AttributeChanged:Connect(function()
    if game.Workspace:GetAttribute("EfficientCooldown") ~= game.Parent and game:GetService("Workspace"):GetAttribute("EfficientCooldown") <= 0 then
        onCooldown = true
        game:GetService("Workspace").Parent:WaitForChild("Workspace"):SetAttribute("EfficientCooldown", cooldown.Value)
    end
end)

coolDown()
vale aurora
ivory pendant
#

Doesn't even give any errors 🥱

normal stump
shut fossil
ivory pendant
shut fossil
#

tyy

ivory pendant
#

bro what

shut fossil
#

no i thought it was just one global cd for the one value

#

didnt see the attribute changed part

ivory pendant
#

lol wtf

#

Under no circumstance whatsoever should anyone at any point use that script I just gave for literally anything lol

ivory pendant
#

This has to be satire

shut fossil
#

game:GetService("Workspace") ~= cooldown wait what does this do

#

im confused

#

evilcat brochacho.

ivory pendant
stark lantern
#

when its already a number?

#

trust issues?

ivory pendant
#

I'm getting ragebaited istg 😭

cold mango
ivory pendant
#

Real

#

Either it's ragebait or these people didn't read past line 2 😔