Drop

Constructor:

Drop()

Description

Triggered when the tool object itself is removed from the backpack.

Examples

Manually add a tool in WorkSpace and add the following script under the tool. Then manually remove the tool from the backpack and observe whether the event that the tool is removed is triggered or not.

local curTool = script.Parent
local part = RWObject.Create("Part") -- create a part
part.Position = Vector3.New(2,1,2)
part.Parent = WorkSpace
part.CollisionEnter:Connect(function(hit) -- make the avatar equipped with the tool when touching the part.
  if hit:IsClass("Avatar") then 
     hit:EquipTool(curTool) -- equip the avatar with the created tool
  end
end)
curTool.Drop:Connect(function() -- register the event that is triggered when the tool is removed
    print("The event that the tool is removed is triggered")
end)