Skip to content

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.

GivePlayerRecipe(pid, recipe)
Parameter Type
pid number the player
recipe string a recipe’s key, name or document

boolean - false for no such recipe or a player not connected

-- the mode's own recipe scroll, from its own inventory
if itemName == "scroll_saviour" then
GivePlayerRecipe(pid, "Saviour Schnapps")
SendClientMessage(pid, COLOR_WHITE, "You can brew Saviour Schnapps now.")
end

RemovePlayerRecipe · SetPlayerRecipes · HasPlayerRecipe · the Recipes group of the index