Skip to content

Recipes Module

STBrian edited this page Nov 5, 2025 · 4 revisions

As the name says, here you'll find functions related to the crafting system of the game. Have you ever wanted to add a crafting recipe to the game? This is the module you need to use. For now you can only register crafting recipes, but, hopefully, in the future, other types of recipes will be added

Events

Game.Recipes.OnRegisterRecipes Triggered when the game is adding recipes

Types

RecipesTable Represents an access to game recipes list

Functions

Game.Recipes.registerShapedRecipe Allows to register a shaped crafting recipe

Game.Recipes.OnRegisterRecipes

This event will be triggered when the game is registering recipes. It also passes one argument to the listener

Game.Recipes.OnRegisterRecipes:Connect(function (arg1)
end)

RecipesTable arg1: Allows access to the game recipes list

Game.Recipes.registerShapedRecipe

This functions allows to add to the game a shaped crafting recipe, the size of the recipe will determine if it will be a 2x2 or a 3x3 recipe, this impacts whether the recipe needs a crafting table or not

Game.Recipes.registerShapedRecipe(recipesTable, resultItem, categoryId, position, line1, line2, line3, components)
  • RecipesTable recipesTable: Provided by Game.Recipes.OnRegisterRecipes event
  • GameItemInstance resultItem: Is the result item of the recipe
  • integer categoryId: The category in which the recipe will be added (1-6)
  • integer position: The position in which the recipe will appear in the category (can be negative or positive)
  • string line1: The upper line of the crafting recipe
  • string line2: The middle line of the crafting recipe
  • string line3: The bottom line of the crafting recipe
  • table<{string, GameItemInstance}> components: Defines the key characters used in lines with an item

Example

Game.Recipes.OnRegisterRecipes:Connect(function (recipesTable)
    local wool = Game.Items.findItemByName("wool")
    local dye = Game.Items.findItemByName("dye")
    if wool and dye then -- Check no nil
        local wool_white = Game.Items.getItemInstance(wool, 1, 0)
        local wool_orange = Game.Items.getItemInstance(wool, 1, 1)
        
        local bone_meal = Game.Items.getItemInstance(dye, 1, 15)
        
        Game.Recipes.registerShapedRecipe(recipesTable, wool_white, 6, 2048, "X#", "", "", {{"X", bone_meal}, {"#", wool_orange}})
    end
end)

Clone this wiki locally