SetPlayerRecipes
Exactly these recipes - the saved ones back at a login, every other one taken away.
For a character’s restore: the recipes listed are taught and every other one is taken away - also what the player’s game still holds from an earlier character, which goes once their game has reported (a few seconds after the spawn). A recipe the list names that does not exist is skipped with a line in the server’s log. Called before the player is in the world, the recipes are taught right after their spawn.
Syntax
Section titled “Syntax”SetPlayerRecipes(pid, recipes)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
recipes |
table | a list of recipe keys, names or documents - {"alchemy:1", "smithing:r_axework02"} |
Returns
Section titled “Returns”boolean - false when recipes is no table, or for a player not connected
Example
Section titled “Example”-- at the login: the recipes saved with the characterlocal saved = {}for _, row in ipairs(rows) do saved[#saved + 1] = row.recipe endSetPlayerRecipes(pid, saved)See also
Section titled “See also”GetPlayerRecipes · OnPlayerLearnRecipe · SetPlayerProgress · the Recipes group of the index
