how would i use debounce in this situtation? ive looked on the wiki and it doesnt make much sense to me. Also how would i be able to make it so if someone clicked they would have to wait a few seconds before they can click again? i dont think im doing it right
local mouse = game.Players.LocalPlayer:GetMouse()
local clicks = 0
wait(5)
mouse.Button1Down:connect(function()
clicks = clicks + 1
if clicks == 3 then
for i = 1,1 do
local Leaderstats = game.Players.LocalPlayer.leaderstats:findFirstChild("Strength")
if Leaderstats ~= nil then
for i = 1,1 do
Leaderstats.Value = Leaderstats.Value + 1
wait(5)
clicks = 0
end
end
end
end
end
end)

2 comments
You could just do "if d then d = false". Also, "findFirstChild" is deprecated, use "FindFirstChild".
@hiimgoodpack tis a habit of mine