Tool.Enabled not working

So I have the following script:

script.Parent.Activated:Connect(function()
	game.Players.LocalPlayer.Character.Humanoid:WaitForChild("Animator"):LoadAnimation(script.Animation):Play()
	script.Parent.Enabled = false
	wait(5)
	script.Parent.Enabled = true
end)

And if I spam it the animation still plays. According to DevHub:

The Enabled property relates to whether or not the Tool can be used.

Help?

If enabled is set to false, then the player can not equip the tool. What you want to do is:

script.Parent.Parent.Humanoid:EquipTool(nil)

If that doesn’t work (Sorry I couldn’t test it myself) you could just set the tool’s parent to the player’s Backpack. Hope this helps!

you could just have a debounce

local AbleToBeUsed = true
script.Parent.Activated:Connect(function()
	if not AbleToBeUsed then return end
	game.Players.LocalPlayer.Character.Humanoid:WaitForChild("Animator"):LoadAnimation(script.Animation):Play()
	AbleToBeUsed = false
	wait(5)
	AbleToBeUsed = true
end)
1 Like

If this is the case, the docs need to be updated: Tool | Roblox Creator Documentation

When set to false, the tool is disabled and the player cannot use the tool. It prevents the tool from being activated or deactivated by the Tool/Activate and Tool:Deactivate functions. It also prevents the Tool.Activated and Tool.Deactivated events from firing for the tool.

Emphasis mine

2 Likes

I could be wrong, I usually don’t use tools for my games, but you should try using a debounce similar to what @PostVivic said.

Yes, that’s why I used it. I thought it should be used like a debouce, but it does something else?

I’m not sure, I use Tool.Enabled, but I actively check Tool.Enabled in Activated, so I use it like a debounce regardless.