Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make so that when you get a gear it gives a countdown of 3 seconds?

title extension: and if u dont click in that time it kills you?

so i want to do this for a hot potato game and since the hot potato isnt instant and u gotta click i want to know because im new to scripting

1 comment

0

To make a cool down make sure in your script you do wait(3)

1 answer

Have you ever heard of Debounce? Thats the function of cooldown

This Is example script, the player can forever touch this part and make the part be angry cuz It doesn't like being step one, however the player needs to wait 1 second before It can make the part say something

Script:

local Part = script.Parent
local Debounce = false

Part.Touched:Connect(function(hit)
    if not Debounce then
        local Humanoid = hit.Parent:WaitForChild("Humanoid")
        if Humanoid then
            Debounce = true
            print("Hey! Stop stepping on me! >:(")
            wait(1)
            Debounce = false
        end
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.