Trouble when using Unequipped tool

I made a script to do certain things when a tool (weapon) is equipped and unequipped, which works fine except if the player suddenly changes tool from typing 1,2,3 while still pressing the mouse button (i.e. while still firing) … somehow this is not triggering the “unequipped tool” event? Any clues?

You could try using AncestryChanged to detect unequip, like the following:

tool.AncestryChanged:Connect(function(_, NewParent)
    if NewParent.Name == "Backpack" then 
    	print("Parented to a Player's backpack")
        -- Your unequip event
    end
end)
1 Like

I´ll try that as soon as I can … many thanks!