Animation not loading in a function

Im trying to make a simple pillar system that spawns a pillar from where your mouse is, but i want to do it with moon to challange myself, all works good but when im trying to clone the pillar and load the animation in the function it dousent work even though it dous work outside of the function.
i also cant find anything on the dev hub about moonanimations not loading in functions, i have also tried to load the animations first and clone that in hopes that the animations already would be loaded but then it only plays the original pillar animation and not the placed pillar.

local ts = game:GetService("TweenService")
local ti = TweenInfo.new(2, Enum.EasingStyle.Linear)

local input = game.ReplicatedStorage.Input



input.OnServerEvent:Connect(function(plr, x, y, z)
	local pillar = workspace.PLSWORKMODEL:Clone()
	pillar.Parent = workspace
	local track = pillar.AnimationController:LoadAnimation(pillar.Animation)
	local track2 = pillar.AnimationController:LoadAnimation(pillar.Animation2)
	local dis = ts:Create(pillar.testPart, ti, {Transparency = 1})
	pillar:SetPrimaryPartCFrame(CFrame.new(x, -5.564, z) * CFrame.Angles(0, math.rad(90), math.rad(90)))
	
	track:Play()

track.Ended:Connect(function()
	
	track2:Play()
	
	task.wait(7)
	
	dis:Play()
	
	dis.Completed:Connect(function()
		
		pillar:Destroy()
		
		end)
	end)
end)


What is the original pillar animation? Is it track or track2 ?

Try Using track.Stopped:Wait() or track.Stopped:Connect(function()