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

Tool Animation Playing when unequipped?

Asked by 4 years ago

I have this idle animation equipped in a tool, which plays the idle when equipped, then if I press W stops and when I release W plays again. But when I am pressing W and unequip the tool at the same time the animation keeps playing. I've tried adding some stuff but nothing is working so I turned to this

01local player = game.Players.LocalPlayer
02 
03repeat wait(1) until player.Character
04 
05local character = player.Character
06local humanoid = character:WaitForChild("Humanoid")
07 
08local userInput = game:GetService("UserInputService")
09 
10local animation = Instance.new("Animation")
11animation.Name = "Idle"
12animation.Parent = script.Parent
13 
14local animation2 = Instance.new("Animation")
15animation2.Name = "Equip"
View all 65 lines...

Answer this question