Hi, Okay i know i litterly made a post a second ago but, For some reason my script does not make the npc play the animation, Heres the script:
local arifgamer = script.Parent
local Character = game.Players.LocalPlayer.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Runservice = game:GetService("RunService")
local Animation = arifgamer.Humanoid.Animator:LoadAnimation(script.Parent.Animation)
Runservice.RenderStepped:Connect(function()
if Humanoid.MoveDirection.Magnitude > 0 then
Animation:Play()
end
end)
Is there anything in the output?
Where is the localscript located?
Localscripts only run when they’re a descendant of the player, inside of their character or in replicatedfirst.
Edit: I’m assuming arifgamer is a different character model than the player’s character, therefore the script just isn’t running. Move it somewhere localscript - friendly. (the previous list)
if the npc is controled by server, use a server script,
and in this script, you are checking your own Character’s Humanoid move speed, and based on this you try to animate the npc. is this correct though?