How can we add a delay on this script from stopping it from running too fast?
So we have a Knife script, That plays an animation when you click. But you can spam click the knife, and it just glitches it out? How could we add a delay or debounce in this to stop the animation from running too fast? Thanks.
Server Script:
01 | game.ReplicatedStorage.ShankIdle.OnServerEvent:Connect( function (player) |
02 | local idleanime = Instance.new( "Animation" ) |
04 | local hum = player.Character.Humanoid |
05 | local idleloader = hum:LoadAnimation(idleanime) |
06 | local sound 1 = Instance.new( "Sound" , hum.Parent) |
13 | game.ReplicatedStorage.Shank.OnServerEvent:Connect( function (player) |
14 | local idleanime = Instance.new( "Animation" ) |
16 | local hum = player.Character.Humanoid |
17 | local idleloader = hum:LoadAnimation(idleanime) |
20 | local anime = Instance.new( "Animation" ) |
22 | local hum = player.Character.Humanoid |
23 | local loader = hum:LoadAnimation(anime) |
30 | game.ReplicatedStorage.QuitShankIdle.OnServerEvent:Connect( function (player) |
31 | local idleanime = Instance.new( "Animation" ) |
33 | local hum = player.Character.Humanoid |
34 | local idleloader = hum:LoadAnimation(idleanime) |