GetPlayerConsumableNames
getPlayerConsumableNames
COMING IN UPDATE 0.1.2
This function is documented in advance and is not yet available in the current public release.
Returns every stable consumable inventory key exposed by the native catalog.
Syntax
table getPlayerConsumableNames()
Parameters
This function does not accept parameters.
Returns
Returns a one-based array of consumable key strings.
Examples
Build a lookup table of supported consumables:
local supported = {}
for _, itemKey in ipairs(getPlayerConsumableNames()) do
supported[itemKey] = true
end
Notes
- Available only in server-side resource scripts.
- The list includes food, drinks, potions and smoking items recognized by the current native catalog.
- A catalog entry does not by itself grant an item. Use the authoritative inventory functions provided by the gamemode.