#cooldown doesnt work gui

11 messages · Page 1 of 1 (latest)

sterile axle
#

whats wrong?

lucid fractal
#

One message removed from a suspended account.

sterile axle
#

when i press again there is no cooldown

#

cooldown doesnt work gui

neat wharf
#

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

sterile axle
#

damn

#

let me try

neat wharf
#

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

sterile axle
neat wharf
#

Yes