#any error?

1 messages · Page 1 of 1 (latest)

unkempt orbit
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local runEvent = ReplicatedStorage:WaitForChild("RunAnimationEvent")
local runAnimationId = "rbxassetid://91701202879948"

local function playRunAnimation(player, play)
local character = player.Character
if not character then return end

local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end

if not humanoid:FindFirstChild("RunTrack") then
   local runAnimation= Instance.new("Animation")
   runAnimation.AnimationId = runAnimationId
   local track = humanoid:LoadAnimation(runAnimation)
   track.Name = "RunTrack"
end

local track = humanoid:FindFirstChild("RunTrack")
if play then
    if not track.IsPlaying then
        track:Play()
    end
else
    if track.IsPlaying then
        track:Stop()
    end
end

end

runEvent.OnServerEvent:Connect(playRunAnimation)

bleak halo
#

Load the animation into the Animator not the Humanoid

#

Read docs

sullen ferry
#

Yes, and also, you dont need to play the animation on the server