https://giphy.com/gifs/MBfpCpfLly2Ib2wase https://giphy.com/gifs/MBfpCpfLly2Ib2wase
When I spam e, you can see the animation starting multiple times. When I press e once it plays once. What could be the problem? Is there something wrong with my debounce?
local Player = game:GetService("Players").LocalPlayer
--print(Player)
local rp = game:GetService("ReplicatedStorage")
local Character = Player.CharacterAdded:Wait()
local humanoid = Character:WaitForChild("Humanoid")
local animation = workspace.Animation
animation.AnimationId = "http://www.roblox.com/asset/?id=5313493309"
local animationTrack = humanoid:LoadAnimation(animation)
local Debris = game:GetService("Debris")
local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
local knockback = rp:WaitForChild("KnockBack")
local UIS = game:GetService("UserInputService")
local push = rp:WaitForChild("Push")
local RemoteEvent = rp:WaitForChild("RemoteEvent")
local debounce = false
local debounce = false
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.E then
if debounce == false then
--print"push Fired"
animationTrack:Play()
wait(0.5)
push:FireServer(Player)
debounce = true
wait(2)
debounce = false
end
end
end)

4 comments
oh, the second line of debounce isnt there, I pasted it wrong
yea, i dont think that worked,. thanks anyways tho
put a print inside if, does actually fire when ur still doing the animation
oh, I changed it and it worked, thanks