Statebags

All states are client side only

invBusy

Returns whether the player's inventory is currently running an action (i.e. using an item). Can be set to true to disable opening the inventory.

type

invBusy

boolean

example

local invBusy = LocalPlayer.state.invBusy
 
if invBusy then
    -- Do stuff when busy
else
    -- Do stuff when not busy
end

Disable opening inventory

LocalPlayer.state.invBusy = true

invHotkeys

Allows you to enable/disable a player's access to inventory hotkeys.

type

invHotkeys

boolean

example

LocalPlayer.state.invHotkeys = false

invOpen

Returns whether the player's inventory is currently open or not.

type

invOpen

boolean

example

local invOpen = LocalPlayer.state.invOpen

if invOpen then
    -- Do stuff when open
else
    -- Do stuff when closed
end

canUseWeapons

Allows you to enable/disable the use of weapons for a player.

LocalPlayer.state.canUseWeapons = false

Last updated