Advertisement
Anukun_Lucifer

MobAnimations EP.03

Oct 21st, 2023
2,401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | Gaming | 0 0
  1. local function animateMob(object)
  2. local humanoid = object:WaitForChild("Humanoid")
  3. local animationsFolder = object:WaitForChild("Animations")
  4.  
  5. if humanoid and animationsFolder then
  6. local walkanimation = animationsFolder:WaitForChild("Walk")
  7. if walkanimation then
  8. local animator = humanoid:FindFirstChild("Animator") or Instance.new("Animator",humanoid)
  9. local walkTrack = animator:LoadAnimation(walkanimation)
  10. walkTrack:Play()
  11. end
  12. end
  13. end
  14.  
  15. workspace.Grassland.Mob.ChildAdded:Connect(animateMob)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement