Hello. I made an animation and a script for a tool. When I click, the animation is supposed to play. Instead nothing happens. If I quickly unequip the tool, the animation plays. Is there a way to make the animation play WITH the tool?
Here is the script:
function onClicked(plr) local ex = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation) ex:Play() end script.Parent.Activated:connect(onClicked)
Thanks
Make this script below a local script after making, this goes in the tool.
plr = game.Players.LocalPlayer mouse = plr:GetMouse() function onClicked(plr) send = script.Parent.Send--Make a RemoveEvent in the tool as well, name it "Send" . Send:FireServer() end mouse.Button1Down:connect(onClicked)
Make this script below a script after making, this goes in the tool.
send = script.Parent.Send send.OnServerEvent:connect(function(plr) ex = plr.Character.Humanoid:LoadAnimation(script.Parent.Animation) ex:Play(1.0) end)
Thats it! If this worked please mark my question the answer so I can get more reputation so I can help others.