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

Can't make animations play (first time using them)

I'm trying to Google a guide on how to play animations, but all I am getting are stupid videos and guides for the animation hack.

All I want to do is make a running animation play in my place when a player runs. I have done this but it's not working. It's frustrating me so badly:

ani = Instance.new("Animation")
ani.AnimationId = "http://www.roblox.com/asset/?id=125749145"
ani.Name = "Run"

animTrack = script.Parent.Humanoid:LoadAnimation(ani)



local isWalking = false


script.Parent.Humanoid.Running:connect(function(speed)
if (speed > 0) then

isWalking = true
animTrack:Play()
else

isWalking = false
animTrack:Stop()
end
end)

1 comment

0

I think I found the answer. Check mine.

3 answers

A possible problem you may be experiencing is that the default animation script is overriding yours when you walk. You could consider temporarily disabling the Animate script while yours plays.

1 comment

0

I was wondering if this would be a problem, I'll go try now.

I think you should just switch the run animation ID when they join. Like this:

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
wait(1) -- Cooldown for parts to load in
character.Animate.run.RunAnim.AnimationId = "http://www.roblox.com/asset/?id=125749145"
-- Switches animation ID
end)
end)


Have a happy Christmas! :D

Shouldn't the ID just be the number after the "id=" part of the URL?

1 comment

0

What do you mean?

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