How to make unequip animation not play when switching to another tool?

I’ve got this tool that has an unequip animation. It works fine if I’m just unequipping it as is, but when I equip another tool while it’s equipped, the script thinks that’s me unequipping it rather than switching to another tool. How can I fix this?

Code, just in case:

function onUnequipped(Mouse) -- Unequip Line
	local Character = Player.Character 
	local Humanoid = Character.Humanoid
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) -- disable inventory		
	UnEquipAnimation:Play()
	EquipAnimation:Stop()
	HoldBandageAnimation:Stop()
	wait(1.2)
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true) -- enable inventory		
end
1 Like

function onUnequipped(Mouse) – Unequip Line
local Character = Player.Character
local Humanoid = Character.Humanoid
wait()
local checktool = Character:GetChildren()
for i = 1,#checktool do —- check if player has another tool/swapped
if checktool[i]:IsA(“Tool”) then
return —- cancel the anim
end
end
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) – disable inventory
UnEquipAnimation:Play()
EquipAnimation:Stop()
HoldBandageAnimation:Stop()
wait(1.2)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true) – enable inventory
end

sorry i’m on mobile and haven’t test this

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.