Functions
Server
Moveitemwithininventory

MoveItemWithinInventory

function WIS.MoveItemWithinInventory(ply, sourceSlotIndex, destinationSlotIndex, up)

Moves an item from one slot to another within the player's inventory. This function is key for inventory organization, allowing players to rearrange their items as needed.

Parameters

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

Use Case

This function is commonly used to allow players to reorganize their inventory, moving items between slots. It's an essential part of the inventory management system

Example

    local player = Entity(1)
    WIS.MoveItemWithinInventory(player, 0, 14, true)