#cooldown doesnt work gui
11 messages · Page 1 of 1 (latest)
One message removed from a suspended account.
Had the same problem today and either im just dumb or doing it too complicated. I did smth like this
local LastTime = 0
local currentTime = os.time()
local cooldown = 5
local function test()
if currentTime-LastTime => cooldown then
LastTime = currentTime
end
end
Its just out of my head, there are maybe some errors
local LastTime = 0
local currentTime = os.time()
local cooldown = 5
local function test()
if currentTime - LastTime >= cooldown then
LastTime = currentTime
print("Cooldown over)
end
end
Try that, should work
Wait is this correct?
local LastTime = 0
local currentTime = os.time()
local cooldown = 10
script.Parent.MouseButton1Click:Connect(function()
if currentTime - LastTime >= cooldown then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
LastTime = currentTime
print("Cooldown over")
end
end)
Yes