Tool.Unequipped does not fire when tool is dropped, but only when SignalBehavior is Deferred

The signal for when a tool is unequipped does not fire if the tool is dropped, but only if SignalBehavior is Deferred/AncestryDeferred.

Reproduction steps:

  1. Create a tool in StarterPack, and add a Handle Part so you can drop the tool.
  2. Insert a LocalScript in the tool.
  3. Using the LocalScript, connect a function to the Unequipped signal. You can make the function do anything, even print to console.
  4. Start a playtest.
  5. Drop the tool.

The function will not run if SignalBehavior is set to Deferred.

Simple reproduction file:
DeferredUnequipped.rbxl (55.3 KB)

Expected behavior

Even if signals are Deferred, I expected them to still fire so I can run code when the player drops an item on the ground.
This code could clean up currently playing animations, or hide GUIs.

Thanks for the report! We’ll take a look.

Sorry to bump this. I was wondering if there was an update on this? I understand that this is due to the LocalScript execution halting (Because the tool was dropped) and therefore disconnecting the listeners associated.

Is there a better way to approach this? Unfortunately this results in an issue where associated GUI elements are not cleaned up.

Bumping this with a simple workaround in case anyone needs it, since this bug has been present for almost a year now:

  1. Move all of your LocalScript code into a ModuleScript in the same tool.
  2. Add a new LocalScript to the tool with the following code:
local Players = game:GetService("Players")

local player = Players.LocalPlayer

local tool = script.Parent

require(tool:WaitForChild("ModuleScript")) -- Replace with the name of the ModuleScript if you changed the name

-- Parent self to PlayerScripts so the script keeps running for a moment after the tool is dropped
script.Parent = player.PlayerScripts

tool:GetPropertyChangedSignal("Parent"):Connect(function()
	if tool.Parent ~= player.Backpack and player.Character ~= nil and tool.Parent ~= player.Character then
		-- Tool is no longer in the backpack and not equipped, so it was either dropped or destroyed
		-- Put self back in the tool so this script stops running
		script.Parent = tool
	end
end)

tool.Destroying:Once(function()
	script:Destroy()
end)

You can also avoid putting the LocalScript in the tool altogether and use an OOP object for your tool’s client code instead. Here’s more information on the topic if you’re unfamiliar:

You can find examples of both implementations in this place file:
ToolDroppingWorkaround.rbxl (63.0 KB)

Hi, just wanted to update we’re still looking into it and I was able to repro from the file, thank you!