verifyRecipe

Description

Verifies whether a player has all required ingredients for a crafting recipe.

Parameters

  • source (number): Source ID of the player.

  • recipe (table): A table where keys are item names and values are required amounts.

Return Value

  • Returns true if the player has all required items.

  • Returns false otherwise.

Example Use Case

local recipe = {
    bread = 2,
    water = 1
}
if ps.verifyRecipe(source, recipe) then
    print("Player can craft the recipe.")
else
    print("Missing ingredients.")
end

Last updated