#Cooldowns
1 messages · Page 1 of 1 (latest)
local cooldown=5
while true do
cooldown-=1
end
..ability```
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()
local workspace = game:GetService("Workspace") and workspace or workspace 💔
Top tier script trust
Doesn't even give any errors 🥱
I can recommend this seems very optimized
i try not to use while true for anything
is this a global cooldown?
Yesn't
bro what
no i thought it was just one global cd for the one value
didnt see the attribute changed part
lol wtf
Under no circumstance whatsoever should anyone at any point use that script I just gave for literally anything lol
wait why not it seems fine
This has to be satire
game:GetService("Workspace") ~= cooldown wait what does this do
im confused
brochacho.
tonumber('5') is just 5
My mind is blown
why.. put it inside tonumber ...
when its already a number?
trust issues?
I'm getting ragebaited istg 😭
Ragebaiter gets ragebaited
its perfect