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

Having trouble making Movement Cycle Animation script,Help?

For some reason I get the output error, ** "Play is not a member of Animation" Help?!**

This localscript works from StarterPack

local WalkIDanimation = Instance.new("Animation")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local RunSpeed = 132 -- the speed they run
local WalkSpeed = 16 -- the speed they walk
local JogSpeed = 59

for i = 1,math.huge do
if Character.Humanoid.WalkSpeed > RunSpeed then
	Character.Humanoid:LoadAnimation(WalkIDanimation)
	WalkIDanimation.AnimationId = "http://www.roblox.com/asset/?id=843278004"
	WalkIDanimation:Play()
elseif Character.Humanoid.WalkSpeed > JogSpeed then
WalkIDanimation.AnimationId = "http://www.roblox.com/asset/?id=865162365"
	WalkIDanimation:Play()
elseif Character.Humanoid.WalkSpeed < RunSpeed then
WalkIDanimation.AnimationId = "http://www.roblox.com/asset/?id=865162365"
	WalkIDanimation:Play()


wait()
end
end

1 answer

Animations are not meant to be played, they are meant to be loaded by a humanoid, which gives you a track to play.

Also you should not set AnimationId inside the loop (more than once).

The way this is set up, tracks would never really play anyway since you start a new one every frame. You probably want to connect Humanoid.Running to a function that smoothly, safely plays certain tracks.

There are many other issues. This is clearly too broken to fix myself. You need to understand animations first.

http://wiki.roblox.com/index.php?title=Animations

http://wiki.roblox.com/index.php?title=Changing_default_character_animations

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