I have this script that plays an animation on a tool whenever i press the mousebutton. However when you spam the mousebutton key, the animation will not finish but is spamming aswell. Is there a way to prevent the animation spamming? So the animation first finish its loop and than start again if the mousebutton is pressed?
local Tool = script.Parent local Animation = Tool.Dig Tool.Activated:Connect(function() local Character = Tool.Parent local Humanoid = Character.Humanoid local AnimationTrack = Humanoid:LoadAnimation(Animation) AnimationTrack:Play() Humanoid.WalkSpeed = 0 AnimationTrack.Stopped:Wait() Humanoid.WalkSpeed = 16 -- proceed end)