so i tried making a animation for a monster model that i made self and it wont work with the animations theres no error either. server script :

local animation = script.Parent.Parent.Animation
animation.AnimationId = "rbxassetid://6086501553"
local anim = script.Parent:LoadAnimation(animation)
local anim2 = script.Parent:LoadAnimation(animation)
anim:Play()
script.Parent.Parent.UpperTorso:GetPropertyChangedSignal("Velocity"):Connect(function()
	if script.Parent.Parent.UpperTorso.Velocity == 0 then
		anim:Stop()
		animation.AnimationId = "rbxassetid://6086522729"
		anim2:Play()
	elseif script.Parent.Parent.UpperTorso.Velocity > 0 then
		anim:Stop()
		animation.AnimationId = "rbxassetid://6086501553"
		anim:Play()
	end
end)
while true do
	for i,v in pairs(workspace:GetChildren()) do
		if v:FindFirstChild("HumanoidRootPart") and v.Name ~= script.Parent.Parent.Name and (v.HumanoidRootPart.Position - script.Parent.Parent.HumanoidRootPart.Position).Magnitude < 20 then
			script.Parent:MoveTo(v.HumanoidRootPart.Position)
		end
	end
	wait()
end

2 comments

0

You don't need to use a whole script to change the walking animations. All you really need to do is change the Walking or Running animation ID in the NPC's Animate script.

0

Alright