Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My animation script doesn't seem to be working properly?

Asked by 5 years ago

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.

1 answer

Log in to vote
0
Answered by
Delude_d 112
5 years ago
--[[ 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.]]
Ad

Answer this question