#Trying to make a cooldown for a countdown

24 messages · Page 1 of 1 (latest)

delicate niche
#
local part = game.Workspace.TestStarter
local isDebounce = false 

part.ClickDetector.MouseClick:Connect(function()
    if isDebounce == false then 
        isDebounce = true 
        for i = 5,1,-1 do 
            print("Test".." "..i)
            task.wait(1)
end
        end
    end
            print("Lava Started")
            part.BrickColor = BrickColor.new("Really red")
            task.wait(10)
            print("Able to start countdown again")
            part.BrickColor = BrickColor.new("Really blue")
            debounce = true 
end)
rare locustBOT
#

studio** You are now Level 11! **studio

delicate niche
#

wait

#

do what do u want

#

only print or

#

do other things

copper anchor
#

just print

#

like wdym

delicate niche
#

then why the unecessary code

copper anchor
#

oh like the brickcolors?

delicate niche
#

yeah

copper anchor
#

i just added it for fun but i can remove them lol

delicate niche
#

remove n send

copper anchor
#

alr

#
local part = game.Workspace.TestStarter
local debounce = false 

part.ClickDetector.MouseClick:Connect(function()
    if not debounce then 
        debounce = true 
        for i = 5,1,-1 do 
            print("Test".." "..i)
            task.wait(1)
        end
    end
            print("Lava Started")
            task.wait(10)
            print("Able to start countdown again")
            debounce = false 
end)
#

i also changed debounce to false at the end

delicate niche
#
local part = game.Workspace.TestStarter
local debounce = false 

part.ClickDetector.MouseClick:Connect(function()
    if debounce == false then 
wait(5)
        debounce = true 
        for i = 5,1,-1 do 
           
            
      
            print("Lava Started")
            task.wait(10)
            print("Able to start countdown again")
            debounce = false 
end
end
end)



#

and

#

?

copper anchor
#

it does a 5 second timer at the start when u click on the button

delicate niche
#

yeah

delicate niche
#

i removed print (i)

#

add it back