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

How do I make an animation play when equipped?

Asked by 4 years ago

Here is the script I attempted to make:

script.Parent.Equipped:Connect(function(Mouse)
    local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
    animation:Play()
end)

So when the tool is equipped the animation should play.

2 answers

Log in to vote
0
Answered by 4 years ago

game.Players.LocalPlayer only works in a localscript, make it an localscript

0
It was already in a Local Script SecretPax 20 — 4y
0
then dont say its a script VerdommeMan 1479 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

you have to make 2 variables, what i mean is

local animation = script.parent
local animaiontrack = animation:LoadAnimation()

Answer this question