Tool animation script not working

I’ve created an tool animation script, but it seems not to work.

local Tool = script.Parent
local Animation = Tool.Animation
local player = game.Players.LocalPlayer
Tool.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
local Character = player.Character or player.CharacterAdded:Wait()
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
print(“Mouse Click Works.”)
end)
end)

It doesn’t show any error in the output. Can someone help me fix it?

why do both ends have a ) after them? normally only one of them need the bracket after them!

I used two functions. One to detect when the tool is equipped and one to detect when the mouse is clicked.

use

Tool.Activated:Connect(function()

it fires every time someone clicks with the tool equipped

1 Like

I tried to use it already, it doesn’t seem to work.

1 Like

Sorry to hear that your script isn’t working. I’d move this topic to #help-and-feedback:scripting-support and I bet you’ll get more help! Good luck, though!

Either way, I’ve 2 things:

  1. Still use Tool.Activated:Connect(function()
  2. Is this a client-sided script (a paper with a player icon) image, if not do change it to that.