Tool equiped not working?

This fires even when the tool is unequipped and I can’t seem to figure out what went wrong.

local debounce, timeout = true, (tool:GetAttribute("Cooldown"))
local function playerClicked()
	if debounce then
		debounce = false
		grenadeSpawnEvent:FireServer(
			player.Character:FindFirstChild("Head").Position,
			camera.CFrame.LookVector,
			tool:GetAttribute("Magnitude"),
			tool:GetAttribute("Damage"),
			tool:GetAttribute("Fuse"),
			tool:GetAttribute("BlastRadius"),
			tool:GetAttribute("Type")
		)
		wait(timeout)
		debounce = true
	end
end

mouse.Button1Down:Connect(function()
	if tool.Equipped and tool then	
		playerClicked()
	end
end)

.Equipped is an event like .Button1Down. You must use :Connect. For example:

tool.Equipped:Connect(function()
    --code here
end)

Tool.Equipped fires when a player equips a tool, I’m not sure if you can use it in an if statement.

Bruh. Yeah .equipped is an event. I completely forgot about that. : P

was solved using this

mouse.Button1Down:Connect(function()
	if tool.Parent == player.Character and tool then	
		playerClicked()
	end
end)

Just a suggestion, that’s very inefficient. It’s much better to use the .Equipped event.