So, I'm trying to make a tool with an animation. (this is my first time scripting). So far I've made the animation on click work, but I'm having two problems.
First problem is that currently if you spamclick it keeps replaying the animation with no delay, and I can't seem to fix this.
Second problem is that I'm trying to make a sound play with the animation as I click my mouse, but I can't make this work either.
I hope someone will be able to help me :)
(Here's my script so far)
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
game.Players.StarterPack.Icecream.Activated:Connect(function()
game.Players.StarterPack.Icecream.Handle.Lick:Play()
end)
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)

2 comments
Also, feel free to ask me if you have anymore questions!
I answered it :D