Problem with anim in animate script

I have try to stop and replay it’s not work

wait(1)
local tool = script.Parent

local char = game:GetService("Players").LocalPlayer.Character
local hum = char:FindFirstChild("Humanoid")
local animload = hum:LoadAnimation(tool.Anim:WaitForChild("Idle"))
local animloadidle = hum:LoadAnimation(tool.Anim:WaitForChild("Trueidle"))

local count = 0
local db = true

local attackanim = {
	tool.Anim.Attack[1],
	tool.Anim.Attack[2],
}

tool.Equipped:Connect(function()
	local char = game:GetService("Players").LocalPlayer.Character
	local hum = char:FindFirstChild("Humanoid")
	local Animate = char:FindFirstChild("Animate")
	local animatewalk = Animate.walk.WalkAnim

	spawn(function()
		animloadidle:Play()
		animatewalk.AnimationId = "rbxassetid://11613535777"
		animatewalk:Stop()
	end)
end)

tool.Unequipped:Connect(function()
	local char = game:GetService("Players").LocalPlayer.Character
	local hum = char:FindFirstChild("Humanoid")
	local Animate = char:FindFirstChild("Animate")
	local animatewalk = Animate.walk.WalkAnim

	spawn(function()
		animloadidle:Stop()
		animatewalk.AnimationId = "rbxassetid://180426354"
		animatewalk:Stop()
	end)
end)

here vid

Definitely use a Preloader if you haven’t already. This has helped me many times. It pre loads animations before the game has started so that when you equip a tool, the animation will have already loaded preventing it from acting buggy in the when you first equip it.

No. it not the load stuff it’s a animate script in char i change my id in walkanim id but it’s not change because it’s already run the default walk anim