I tried making an UserInputService, when player presses Q, the animation plays, and it worked fine.
But when I try to make the same but when the tool is clicked it doesn't work. I don't get any error or anything, it just won't play, am I missing something?!
local Mouse = game.Players.LocalPlayer:GetMouse()
script.Parent.Activated:Connect(function()
if Mouse.Target then
if Mouse.Target.Parent:FindFirstChild("Humanoid") then
print("There is humanoid")
script.Parent.RemoteEvent:FireServer(Mouse.Target)
game.Players.LocalPlayer.Character.Humanoid.Animator:LoadAnimation(game.ReplicatedStorage.Animation):Play()
else
print("No Humanoid")
end
end
end)

2 comments
Make a variable for the animation. local anim = humanoid:LoadAnimation(game.ReplicatedStorage.Animation)
Also, print if the animation is playing or not. That makes it check if it is playing or not. print(anim.IsPlaying)