Skip to content

Inventory - Types/Gridinv/Submodules/Storage

This page documents the hooks defined by the types/gridinv/submodules/storage submodule in the inventory module.


CanPlayerSpawnStorage(client, entity, info)View Source

Purpose

Determines whether a player may convert an entity into storage.

Realm

Server

Parameters

Player client The player trying to create the storage entity.

Entity entity The target entity being turned into storage.

table info The requested storage configuration data.

Returns

boolean|nil Return false to block storage creation.


CanSaveData(ent, inventory)View Source

Purpose

Determines whether a storage entity's inventory data should be persisted.

Realm

Server

Parameters

Entity ent The storage entity being saved.

table inventory The inventory attached to the storage entity.

Returns

boolean|nil Return false to skip saving this storage inventory.


InitializeStorage(entity)View Source

Purpose

Called when the storage system initializes a storage-capable entity.

Realm

Shared

Parameters

Entity entity The storage entity being initialized.


OnCreateStoragePanel(localInvPanel, storageInvPanel, storage)View Source

Purpose

Called after the client creates the paired inventory panels for a storage UI.

Realm

Client

Parameters

Panel localInvPanel The local player's inventory panel.

Panel storageInvPanel The storage inventory panel.

Entity storage The storage entity being viewed.


StorageCanTransferItem(client, storage, item)View Source

Purpose

Determines whether a player may transfer a specific item through a storage interaction.

Realm

Server

Parameters

Player client The player attempting the transfer.

Entity storage The storage entity involved in the transfer.

table item The item being moved.

Returns

boolean|nil Return false to block the item transfer.


StorageEntityRemoved(entity, inventory)View Source

Purpose

Called when a storage entity is removed and its attached inventory is being cleaned up.

Realm

Server

Parameters

Entity entity The storage entity being removed.

table inventory The inventory attached to the entity.


StorageInventorySet(entity, inventory, isCar)View Source

Purpose

Called after a storage entity is assigned an inventory.

Realm

Shared

Parameters

Entity entity The storage entity receiving the inventory.

table inventory The inventory assigned to the entity.

boolean isCar Whether the storage entity is a vehicle trunk.


StorageRestored(ent, inventory)View Source

Purpose

Called after persisted storage data is restored onto an entity.

Realm

Server

Parameters

Entity ent The storage entity that was restored.

table inventory The restored inventory.


StorageUnlockPrompt(entity)View Source

Purpose

Called on the client when a storage unlock prompt should be shown.

Realm

Client

Parameters

Entity entity The locked storage entity requesting unlock input.