Skip to main content
Inventory 4.0

Client state bags

Read the inventory interface state and control the quick-access slots.

LocalPlayer.state.inventoryOpenedboolean (read-only)

Indicates whether the local inventory is currently open.

LocalPlayer.state.shortkeysboolean

Enables or disables the inventory quick-access slots.

Read-only state

Use inventoryOpened only as a getter. Do not set the inventory open state through this value.

Configuration

Check the inventory state

Run logic while the local inventory is open.

if LocalPlayer.state.inventoryOpened then
-- Do something
end
Configuration

Control quick-access slots

Disable the quick-access slots while a player is cuffed and enable them again afterward.

AddEventHandler("onPlayerCuffed", function()
LocalPlayer.state.shortkeys = false
end)

AddEventHandler("onPlayerUnCuffed", function()
LocalPlayer.state.shortkeys = true
end)