Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My hammer smashing animation Script is acting strange?

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

0

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

1 answer

There was nothing wrong with the animation, I just found out that I forgot to put the animation ID in the Animation. That's the reason why it was not working.

Woops.

This discussion is preserved as it was. New answers, comments, and votes are closed.