Skip to content

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.

SetPlayerRecipes(pid, recipes)
Parameter Type
pid number the player
recipes table a list of recipe keys, names or documents - {"alchemy:1", "smithing:r_axework02"}

boolean - false when recipes is no table, or for a player not connected

-- at the login: the recipes saved with the character
local saved = {}
for _, row in ipairs(rows) do saved[#saved + 1] = row.recipe end
SetPlayerRecipes(pid, saved)

GetPlayerRecipes · OnPlayerLearnRecipe · SetPlayerProgress · the Recipes group of the index