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 3 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 3 years ago

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

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

you have to make 2 variables, what i mean is

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

Answer this question