GrantPlayerConsumable
grantPlayerConsumable
Grants a supported authoritative consumable item to a player.
Syntax
bool grantPlayerConsumable(int playerId, string itemKey, int count)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player receiving the item. |
itemKey |
string |
yes | A supported consumable key. |
count |
int |
yes | Quantity from 1 through 100. |
Returns
Returns true when the item grant is accepted; otherwise returns false.
Examples
Grant three strong mana potions:
grantPlayerConsumable(playerId, "strong_mana_potion", 3)
Notes
- Available only in server-side resource scripts.
- The current implementation supports
strong_mana_potion.