GivePlayerRecipe
Teaches the player’s character a recipe - the book shows it from now on.
Silently, with no notice: the alchemy table’s or the anvil’s book shows the recipe the next time the player opens it. Giving a
recipe the character knows is fine. Called before the player is in the world, the recipe is taught right after their spawn.
OnPlayerLearnRecipe is not called for it.
Syntax
Section titled “Syntax”GivePlayerRecipe(pid, recipe)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
recipe |
string | a recipe’s key, name or document |
Returns
Section titled “Returns”boolean - false for no such recipe or a player not connected
Example
Section titled “Example”-- the mode's own recipe scroll, from its own inventoryif itemName == "scroll_saviour" then GivePlayerRecipe(pid, "Saviour Schnapps") SendClientMessage(pid, COLOR_WHITE, "You can brew Saviour Schnapps now.")endSee also
Section titled “See also”RemovePlayerRecipe · SetPlayerRecipes · HasPlayerRecipe · the Recipes group of the index
