The sounds are out of sync, I think I coded the debounce incorrectly, and I kick two times even though I press "f" once. I tried everything.
plr = game.Players.LocalPlayer
uis = game:GetService("UserInputService")
debounce = true
repeat wait() until plr
local function ReceiveInput(Input)
local IT = Input.UserInputType
if IT == Enum.UserInputType.Keyboard then
if Input.KeyCode == Enum.KeyCode.F and debounce then
debounce = false
animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=357501529"
AnimTrack = plr.Character.Humanoid:LoadAnimation(animation)
AnimTrack:Play()
sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://146163534"
sound.Parent = plr.Character:FindFirstChild("Right Leg")
sound.PlayOnRemove = true
game.Debris:AddItem(sound,0)
end
wait(1)
debounce = true
AnimTrack:Stop()
game.Debris:AddItem(animation,0)
end
end
uis.InputBegan:connect(ReceiveInput)
uis.InputEnded:connect(ReceiveInput)
uis.InputChanged:connect(ReceiveInput)
