Because you’re creating another animationTrack when you unequip and it stops that new track instead of the one that’s currently playing. I think you only need the Animations.Idle:Stop() in the unequipped event, and probably something to set Animation.Idle to nil
local player = game.Players.LocalPlayer
local Character = player.Character
local idle = nil;
idle = player.Character.Humanoid:LoadAnimation(script.Parent.Idle)
script.Parent.Equipped:Connect(function()
idle:Play()
end
script.Parent.Unequipped:Connect(function()
idle:Stop()
end)
local player = game.Players.LocalPlayer
local Character = player.Character
repeat wait() until player.Character and player.Character:FindFirstChild("Humanoid")
local Animations = {
["Idle"] = player.Character.Humanoid:LoadAnimation(script.Parent.Idle),
}
script.Parent.Equipped:Connect(function()
Animations.Idle:Play()
end)
script.Parent.Unequipped:Connect(function()
Animations.Idle:Stop()
end)
script.Parent.Activated:Connect(function()
--
end)
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local Animations = {
["Idle"] = nil,
}
script.Parent.Equipped:Connect(function()
if not Animations.Idle then
Animations.Idle = player.Character.Humanoid.Animator:LoadAnimation(script.Parent.Idle)
end
Animations.Idle:Play()
end)
script.Parent.Unequipped:Connect(function()
Animations.Idle:Stop()
end)
script.Parent.Activated:Connect(function()
--Code
end)