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

My Animation for my weapon isnt working and there isnt an error?

So, right now im making my custom animation but my script isnt working. Its a local script and its inside of my tool. The tool is a ball (the material is granite) and its only a single part, but it does have a particle emitter in it.

player = game.Players.LocalPlayer
repeat wait(0.001) until player.Character
character = player.Character
Canswing = true

animation = character.Humanoid:WaitForChild(script.Parent.OrbOfFury)

script.Parent.animation:play(function()
		
	
end)

My animationID is here: https://www.roblox.com/library/576159820/Orb-of-fury

When I test it it says: OrbOfFury is not a valid member of Tool

Please Help!

1 answer

This is a common bug I experience myself, it is probably cause the Humanoid isn't loaded when the :LoadAnimation() line is read.

Basically, to fix this all you need to do is wait for the Humanoid to load, you can do this by using the :WaitForChild() method.

6 comments

0

Thankyou!

0

hmm, I dont know why its not working. I replaced the loadAnimation for waitforchild but now when I equipt the item the hand stays in the usual idle roblox pose

0

It is because you are not Playing the animation anywhere in the code. Use animation:Play().

0

ok

0

Still coming up with the error

0

What does the error say?

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