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
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
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.
1 comment
To make a cool down make sure in your script you do wait(3)