Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer
--[[ 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.]]

This discussion is preserved as it was. New answers, comments, and votes are closed.