Items
Custom
hooks
Unequipitem

UnequipItem

hook.Add("WIS.UnequipItem", "WIS.DefaultUnequip", function(ply, item, inv) end)

Called when a item is unequipped

Returns

NameTypeDescription
plyEntityThe player who unequipped the item.
itemtableThe item that was uneqipped.
invtableThe player who eunquipped the item's inventory.

Use Case

This hook is typically used for custom items

Example

hook.Add("WIS.UnequipItem", "WIS.DefaultUnequip", function(ply, item, inv)
    local funcs = customfuncs["OnUnequip"]
    for _,v in pairs(funcs) do
        if item.name == _ then
            v(ply, item, inv)
        end
    end
end)