Functions
Server
Removeitemfrominventory

RemoveItemFromInventory

function WIS.RemoveItemFromInventory(ply, slotIndex, up)

Removes an item from a specified slot in the player's inventory. This function is crucial for inventory management, allowing for the removal of items from the player's inventory.

Parameters

NameTypeDescription
plyEntityThe player entity whose inventory is being modified.
slotIndexintegerThe index of the slot from which the item is to be removed.
upbooleanA flag indicating whether to update the inventory UI.

Use Case

This function is essential for operations that involve removing items from a player's inventory, such as when an item is used, dropped, or traded. It ensures that the inventory accurately reflects the player's current possessions.

Example

local player = Entity(1)
local slotToRemove = 3
WIS.RemoveItemFromInventory(player, slotToRemove, false)