RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Write a script that animates an R15 NPC"
-- server script local NPC = game.Workspace.NPC local humanoid = NPC:WaitForChild("Humanoid") local animator = humanoid:WaitForChild("Animator") local idleAnimation = Instance.new("Animation") idleAnimation.AnimationId = "rbxassetid://YOUR_IDLE_ANIMATION_ID_HERE" local idleTrack = animator:LoadAnimation(idleAnimation) local walkAnimation = Instance.new("Animation") walkAnimation.AnimationId = "rbxassetid://YOUR_WALK_ANIMATION_ID_HERE" local walkTrack = animator:LoadAnimation(walkAnimation) local function animate() while true do if humanoid.MoveDirection.Magnitude > 0 then if walkTrack.IsPlaying == false then idleTrack:Stop() walkTrack:Play() end else if idleTrack.IsPlaying == false then walkTrack:Stop() idleTrack:Play() end end wait() end end animate()