The idle animation does not stop after the tool is unequipped.
This is what I have:
local Screen
local Tool = script.Parent
local EquipAnimation = script.Parent.Equip
local UnequipAnimation = script.Parent.Unequip
local IdleAnimation = script.Parent.Idle
Tool.Equipped:Connect(function()
local Humanoid = Tool.Parent.Humanoid
local Track = Humanoid:LoadAnimation(EquipAnimation)
Track:Play()
if not game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("ScreenGui") then
wait(2)
Screen = script.Parent.ScreenGui:Clone()
Screen.Parent = game:GetService("Players").LocalPlayer.PlayerGui
end
local Trackidle = Humanoid:LoadAnimation(IdleAnimation)
Trackidle:Play()
end)
Tool.Unequipped:Connect(function()
Screen:Destroy()
Trackidle:Stop()
end)
