repeat wait () until game.Players.LocalPlayer.Character
local Char = game.Players.LocalPlayer.Character local UIS = game:GetService("UserInputService") local debounce = false
UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F and debounce == false then debounce = true local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/asset/?id=2052969242" local playanimation = Char.Humanoid:LoadAnimation(animation) playanimation:Play() wait(3) debounce = false end
end)
So this is the script for my animation but it doesn't seem to work properly because whenever i pressed the F key just once, the animation will keep on running and it will make my walk look funny.
--[[ Add a "Animation:Stop()". After a delay you desire. Or, turn off the animations loop. Using "Animation.Looped = false" or turn it off from the animation plugin settings.]]