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

Why wont this animation script work?

Asked by
NexeusX 137
8 years ago

I put this in a simple NPC it has a HumanoidRootPart and everything why wont it work?

local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=392699385" 

local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)

animTrack:Play()

it is in a local script.

1 answer

Log in to vote
1
Answered by 8 years ago

game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local findanimate = character:FindFirstChild("Animate") findanimate:WaitForChild("walk"):WaitForChild("WalkAnim").AnimationId = 'http://www.roblox.com/asset/?id=392699385' wait(1) end) end)

That's what I have for my game. It's for a player joining the game though. I changed the anim id to yours. You will have to change the script so it works into a NPC. So probably something like this A local script runs on the client. A normal script runs on the server. So you might want it to run on a server. If the following code doesn't help, try putting the original code into a normal script and see if that helps.

local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=392699385"

Assuming you have the NPC walking around already, all you really need to do is just change the animation id. That's not really going to help though. May I see the entire script please?

0
Ok thanks i figured the rest out on my own, thanks for the help! NexeusX 137 — 8y
0
You're welcome! TheNoobBoss1012 0 — 8y
Ad

Answer this question