GrantPlayerConsumable: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 32: | Line 32: | ||
* The current implementation supports <code>strong_mana_potion</code>. | * The current implementation supports <code>strong_mana_potion</code>. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Magic Functions]] | [[Category:Magic Functions]] | ||
[[Category:Progression Functions]] | [[Category:Progression Functions]] | ||
Latest revision as of 09:53, 15 August 2026
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.