How Do I Make Debounce so the player has to wait 3 seconds to get +5 speed again?

local PunchBack = game.Workspace:FindFirstChild(“PunchBag”)
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
PunchBack.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
player.leaderstats.Speed.Value = player.leaderstats.Speed.Value + 5
print(player.Name…“Touched!”)

	end

end)

end)

Try this

local debounce = false
script.Parent.MouseButton1Click:Connect(function()
PunchBack.Touched:Connect(function(hit)
if debounce == false then
if hit.Parent:FindFirstChild(“Humanoid”) then
player.leaderstats.Speed.Value = player.leaderstats.Speed.Value + 5
print(player.Name..“ Touched!”)
debounce = true
wait(3)
debounce = false
	end
end
end)

Edit note: I don’t see that you called “player” in the script.
Another note: Reply me if you try it please