So i have a script where i loaded my animation and i want to play the animation from another script.
first script:
self.ChildAdded:Connect(function(c)
if c:IsA("Tool") then
for i,v in pairs(c:GetDescendants()) do
if v:IsA("Animation") then
ActionAnims[tostring(v.Name)] = Humanoid.Animator:LoadAnimation(v)
end
end
end
end)
And part of the other script:
if tool.Parent and tool.Parent:FindFirstChildOfClass("Humanoid") and tool.Parent.Humanoid.Health > 0 and tool.Parent.Humanoid:FindFirstChildOfClass("Animator") then
local loadedAnimations =
tool.Parent.Humanoid:FindFirstChildOfClass("Animator"):GetPlayingAnimationTracks()
for i,v in pairs(loadedAnimations) do
print(v.Animation.AnimationId)
print(tool.Aim.AnimationId)
print(3)
if v.Animation.AnimationId == tool.Aim.AnimationId then
v.Animation:Play()
end
end
isEquipped = true
end
end
Why is it not showing the animation i loaded from the first script in the other script?