this is caused because whenever you unequip the tool, you are stopping a new AnimationTrack, which never played.
To counter this issue, there are multiple ways how can you go about this (I can think of 2). I will try to explain one of them to you.
When you equip the tool, you want to load the animation in (like you do right now) and store the AnimationTrack object inside of a table, which can be accessed when the Player unequips the tool. When you will have this done, you can simply check for the Player’s AnimationTrack in the table you made when the tool was equipped.
This is how I can imagine your fixed code:
local playerIdleAnimations = {}
fists["Equip"].OnServerEvent:Connect(function(player, LisEquipped)
print("silly")
local isEquipped = player.Stats.isEquipped
if LisEquipped == true then
local idle = player.Character.Humanoid:LoadAnimation(fists.Anims["Idle"])
playerIdleAnimations[player] = idle
isEquipped.Value = true
idle:Play()
print("silly1")
else
isEquipped.Value = false
local idle = playerIdleAnimations[player]
if idle then
idle:Stop()
playerIdleAnimations[player] = nil -- prevent memory leaks
end
print("silly2")
end
end)
I wrote this in the browser, so please excuse any bad formating/mistakes I might’ve made.