Tool not activating

Hi,

My tool isn’t activating, and I don’t see anything output.

image

local tool = Instance.new("Tool")
tool.RequiresHandle = false
tool.Parent = script.Parent

tool.Equipped:Connect(function()
    tool:Activate()
end)

function toolActivated()
    print("Tool activated")
end

tool.Activated:Connect(toolActivated)

does the script is a local script?

No, I was told to prevent using localscript for exploiters.

Activated Event is only in a local script. its the property of the tool

image

1 Like

I see, I did that, but still won’t activate.

I want it to play an animation when activated, but there be a cooldown too.

here is my suggestion:

local script:

local cooldown = 5
local Debounce = false

local player = game.Players.LocalPlayer
local anim = game.Workspace --your animation location

local human = player.Character:FindFirstChild("Humanoid")
local playAnim = human:LoadAnimation(anim)

script.Parent.Activated:Connect(function()
	if Debounce == false then
		Debounce = true
		playAnim:Play()

		wait(cooldown)
		Debounce = false
	end
end)
1 Like

Just want to point out that using Humanoid:LoadAnimation is deprecated.
It has been moved into the child of Humanoid with an Instance called Animator
So the new “updated” version is Humanoid.Animator:LoadAnimation you will run into replication issues with Humanoid:LoadAnimation

yes i forgot about it thanks for the point

No prob, sometimes it’s hard to figure out why animation replication isn’t working because of it.