xxxxxxxxxx
local animation = script:WaitForChild('firstanimation')
local humanoid = script.Parent.Parent:WaitForChild('Humanoid')
local firstAnimation = humanoid:LoadAnimation(animation)
firstAnimation:Play()
firstAnimation.Looped = true
xxxxxxxxxx
local function PlayAnimation(character, animation)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
-- need to use animation object for server access
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animationTrack = animator:LoadAnimation(animation)
animationTrack:Play()
return animationTrack
end
end
end