Wanders Inventory SystemAboutAboutContactContact (opens in a new tab)
DiscordDiscord (opens in a new tab)
  • Introduction
  • Config
    • Exampleconfig
    • Index
    • Recipes
  • Functions
    • Server
      • Additemtoinventory
      • Additemtoslot
      • Findemptyslot
      • Moveitemwithininventory
      • Removeitemamt
      • Removeitemfrominventory
      • Retrievedata
  • Items
    • Format
    • Custom
      • Internal
      • hooks
        • Equipitem
        • Onuse
        • Unequipitem
    • Data
      • Durability
      • Maxdurability
      • Rarity
      • Strength
      • Stats
        • Armor
        • Crafting Proficiency
        • Damage
        • Healing Efficiency
        • Health
        • Jump
        • Luck
        • Resistance
        • Slots
        • Speed
    • Types
      • Accessory
      • Chest
      • Feet
      • Head
      • Item
      • Legs
      • Stim
  • Introduction
  • About
  • Config
    • Exampleconfig
    • Index
    • Recipes
  • Functions
    • Server
      • Additemtoinventory
      • Additemtoslot
      • Findemptyslot
      • Moveitemwithininventory
      • Removeitemamt
      • Removeitemfrominventory
      • Retrievedata
  • Items
    • Format
    • Custom
      • Internal
      • hooks
        • Equipitem
        • Onuse
        • Unequipitem
    • Data
      • Durability
      • Maxdurability
      • Rarity
      • Strength
      • Stats
        • Armor
        • Crafting Proficiency
        • Damage
        • Healing Efficiency
        • Health
        • Jump
        • Luck
        • Resistance
        • Slots
        • Speed
    • Types
      • Accessory
      • Chest
      • Feet
      • Head
      • Item
      • Legs
      • Stim
  • Contact (opens in a new tab)

On This Page

  • OnUse
  • Returns
  • Use Case
  • Example
Question? Give us feedback → (opens in a new tab)Edit this page
Items
Custom
hooks
Onuse

OnUse

hook.Add("WIS.OnUse", "WIS.DefaultUse", function(ply, item, inv) end)

Called when a item is used

Returns

NameTypeDescription
plyEntityThe player who used the item.
itemtableThe item that was used.
invtableThe player who used the item's inventory.

Use Case

This hook is typically used for custom items

Example

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

Wanders Inventory System