How to make it so that when i equip a tool, a animation plays?
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?
01 | local FightTool = game.StarterPack.Fight |
03 | local function onEquip() |
05 | local thePlayer = game.Players.LocalPlayer |
06 | local animation = game.StarterPack.Fight.LocalScript.Animation.AnimationId |
07 | local humanoid = thePlayer.Character.Humanoid |
10 | local animationn = Instance.new( "Animation" ) |
11 | animationn.AnimationId = animation |
14 | local PlayAnimation = humanoid:LoadAnimation(animationn) |
19 | FightTool.Equipped:Connect(onEquip) |