Trouble with Tree Chopping System

im making a tree chopping system but im getting a problem where when you “swing the axe” it will just rapidly remove all of the tree “health” is there a way to make it so that every click removes only one

im using a remote event from the tool to a script in the tree
here is the tool code

local tool = script.Parent
local event = game:GetService("ReplicatedStorage")
local chop = event.Chop
local player = game.Players.LocalPlayer

tool.Activated:Connect(function()
    chop:FireServer(player)
end)

here is the tree code

local tree = script.Parent
local hp = script.Parent.HP.Value
local event = game.ReplicatedStorage:WaitForChild("Chop")
local ghost = script.Parent.Ghost
local debouce = true
local cooldownTime = 2

event.OnServerEvent:Connect(function(player, humanoid)
	tree.Touched:Connect(function(Obj)

		local stat = player.leaderstats.OakWood.Value


		debouce = false  

		wait()
		if Obj.Name == ("Blade") then
			hp = hp - 1
			stat = stat + 1
			print(hp)
			wait(0.5)
			if hp == 0 then
				tree.Anchored = false
				tree.Rotation = Vector3.new(-10, 0, 0)
				wait(10)
				tree.Anchored = true
				tree.Position = ghost.Position
				tree.Rotation = ghost.Rotation
				hp = 3

			end
		end


		wait(cooldownTime)
		debouce = true
	end)
end)

In your server code put

local tree = script.Parent
local hp = script.Parent.HP.Value
local event = game.ReplicatedStorage:WaitForChild("Chop")
local ghost = script.Parent.Ghost
local debouce = true
local cooldownTime = 2

event.OnServerEvent:Connect(function(player, humanoid)
	tree.Touched:Connect(function(Obj)
	if debouce == true then
		local stat = player.leaderstats.OakWood.Value


		debouce = false  

		wait()
		if Obj.Name == ("Blade") then
			hp = hp - 1
			stat = stat + 1
			print(hp)
			wait(0.5)
			if hp == 0 then
				tree.Anchored = false
				tree.Rotation = Vector3.new(-10, 0, 0)
				wait(10)
				tree.Anchored = true
				tree.Position = ghost.Position
				tree.Rotation = ghost.Rotation
				hp = 3

			end
			end


			wait(cooldownTime)
			debouce = true
		end
	end)
end)

I don’t recommend putting events in an event block, it will lead to problems like events firing more than once. Put the tree.touched event outside the Event block.

well i want it to detect only when the event fires thats why it in there

Did it work? If you still want to detect when the event fires, set a boolean value inside the event block. then check it in the touched event block.

Yes it worked thanks dude I could do the bool later if needed