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

How to make it so that when i equip a tool, a animation plays?

Asked by 3 years ago

I been trying to make it so that when a player equips a tool, a animation plays.

This is what if have so far, when I test it, nothing happens. Can anybody help figure what went wrong and why the animation wont play when the tool is equipped?

local FightTool = game.StarterPack.Fight

local function onEquip()

    local thePlayer = game.Players.LocalPlayer
    local animation = game.StarterPack.Fight.LocalScript.Animation.AnimationId
    local humanoid = thePlayer.Character.Humanoid


    local animationn = Instance.new("Animation")
    animationn.AnimationId = animation


    local PlayAnimation = humanoid:LoadAnimation(animationn)
    PlayAnimation:Play()

end

FightTool.Equipped:Connect(onEquip)




0
Is your animation priority Action? pokemine1o9 44 — 3y
0
Oh wait, you're getting the tool from the starter pack, not the players backpack. Try getting it from the players backpack instead pokemine1o9 44 — 3y
0
I tried both and it did not work oof fireyfoxninja21 9 — 3y

Answer this question