Long story short i'm trying to make a hammer that can just do a smashing animation when you click. But the thing here is that Roblox is saying attempt to index nil with 'Humanoid. I've tried everything that came to my mind but nothing is working.
I honestly don't think the code is right. But I could be wrong.
local Hammer = script.Parent.Hammer --The animation stored in a folder
local Tool = script.Parent.Parent --The Hammer
local Main_Hammer = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Hammer)
Main_Hammer.Priority = Enum.AnimationPriority.Action
Tool.Activated:Connect(function()
Main_Hammer:Play()
end)
And yes im using a local script, which is inside of a tool.
Do you have any idea whats wrong with it?

1 comment
Oh I just realized, I forgot to put the assetId in the animation. Ooops!