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

Why isn't my animation tool local script not working? *NEED ANSWER QUICK!

Asked by 6 years ago

So, I made some gymnastics animations, and I put it into a tool so that when you equip the tool and click anymore with the mouse, it plays the animation. It works perfectly on Roblox Studio. But, when I go to play it on my game, it doesn't work at all. Is it because of filtering enabled, or what? I'm confused. What am I doing wrong?

Tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")

local animation = Tool.Handstand --Change DanceAnim to the name of your animation.
local AnimTrack = hum:LoadAnimation(animation) --Loads the animation into the humanoid.

Tool.Activated:connect(function(mouse) --If you're using a tool, change Selected to Activated, and get rid of the code on the next line. Otherwise, keep this the same.
    AnimTrack:Play()
    end)
AnimTrack.Priority = Enum.AnimationPriority.Action

Tool.Unequipped:connect(function() --If you're using a tool, change Deselected to Unequipped. Otherwise keep it the same.
    AnimTrack:Stop()
end)

1 answer

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

hmm.. well you see your plugin must be wrong. Use this video https://www.youtube.com/watch?v=MUC738JoiFs works like a frickin charm.

Ad

Answer this question