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

Pause is not a valid member of AnimationTrack ?

Hello I'm Am Not Sure Why Its Is Giving Me This The Thing That's Confusing Me Is Pause Is Supposed To Be A Valid Member?The Script is a LocalScript Inside Of StarterCharacterScripts Please Give Me Some Advice On What i Should Do.

local uis = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character.Humanoid
local anim = Instance.new("Animation")
anim.AnimationId = 'rbxassetid://5549362459' 
local PlayAnim = Character:LoadAnimation(anim)


uis.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		Character.WalkSpeed = 21
		while true do
			wait(0.01)
	      PlayAnim:Play()
		end
	end
end)

uis.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		Character.WalkSpeed = 16
		        while true do
			wait(0.01)
			PlayAnim:Pause()
		end
	end
end)

3 comments

0

I don't think you should use a loop when the input ends, try just pausing it without the loop.

0

thanks for the help but its still giving the error.

0

PlayAnim:Stop()

2 answers

✓ Accepted answer

Please Don't Type Like This, It's Really Annoying.

It really depends on what you want to do, however, in your case, I think you should use :Stop()

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