Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago
Edited 8 years ago

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

Log in to vote
0
Answered by
StoIid 364 Moderation Voter
8 years ago

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.

0
Thankyou! Benified4Life 2 — 8y
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 Benified4Life 2 — 8y
0
It is because you are not Playing the animation anywhere in the code. Use `animation:Play()`. StoIid 364 — 8y
0
ok Benified4Life 2 — 8y
View all comments (2 more)
0
Still coming up with the error Benified4Life 2 — 8y
0
What does the error say? StoIid 364 — 8y
Ad

Answer this question