I've tried doing this before when a player clicks a part but I don't understand how. I also tried making a script where an animation will play when a player clicks with a tool but it failed as well. On the wiki it says LoadAnimation is deprecated? How would I do this?
✓ ANSWER ACCEPTED
How could I make an animation play when a player clicks a part?
1 answer
✓ Accepted answer
Firstly, put a Script and ClickDetector in the part then, inside the script type:
script.Parent.ClickDetector.MouseClicked:Connect(function()
-- [ this is just a example of how to load the animation ]
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
-- [ this is just a example of how to load the animation ]
end)
Sorry for the bad formatting on mobile
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Tho this is not a tool. it’s a part button
Hey! Thank you, would that need to be a local script? Do I just insert the animation into the part I want or does it matter?
I haven’t figured that out yet :(. But I bet you can :)