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

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

Asked by
Ripull 45
10 years ago

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)
0
I think I found the answer. Check mine. Geobloxia 251 — 5y

3 answers

Log in to vote
0
Answered by 10 years ago

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.

0
I was wondering if this would be a problem, I'll go try now. Ripull 45 — 10y
Ad
Log in to vote
0
Answered by
Geobloxia 251 Moderation Voter
5 years ago

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

Log in to vote
-1
Answered by 10 years ago

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

0
What do you mean? Ripull 45 — 10y

Answer this question