Statebags
All states are client side only
Statebags are exactly the same as ox inventory.
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
endDisable opening inventory
LocalPlayer.state.invBusy = trueinvHotkeys
Allows you to enable/disable a player's access to inventory hotkeys.
type
invHotkeys
boolean
example
LocalPlayer.state.invHotkeys = falseinvOpen
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
endcanUseWeapons
Allows you to enable/disable the use of weapons for a player.
LocalPlayer.state.canUseWeapons = falseLast updated