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

How could I make an animation play when a player clicks a part?

Asked by 2 years ago

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?

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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

0
Tho this is not a tool. it’s a part button MAD_DENISDAILY2 137 — 2y
0
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? palatoy 4 — 2y
0
I haven’t figured that out yet :(. But I bet you can :) MAD_DENISDAILY2 137 — 2y
Ad

Answer this question