πŸ”·How To Add New Food Items

Table of Contents

  • Configuration Guide

    • Ingredients

    • Drinks

    • Meals

    • Item Types

  • Notes

Configuration Guide

This guide explains how to add new items (ingredients, drinks, and meals) to the st-snrbuns FiveM script by editing the data/config.lua file.

Ingredients

Ingredients are defined in the Config.ingredients table:

-- Basic ingredient structure
tomato = {
    label = 'Tomato',        -- Display name
    emoji = 'πŸ…',           -- Emoji representation
    image = 'image_url',    -- URL to ingredient image
    default = 250,          -- Starting quantity (optional)
    show = true/false       -- Whether to show in inventory (optional)
}

-- Example configuration
Config.ingredients = {
    bacon = {
        label = 'Bacon',
        emoji = 'πŸ₯“',
        image = 'https://example.com/bacon.png',
        default = 100
    }
}

Drinks

Drinks are defined in the Config.drinks table:

-- Example drink configuration
Config.drinks = {
    ['sprunk'] = {
        label = 'Sprunk',
        emoji = 'πŸ₯€',
        image = 'image_url'
    }
}

Meals

Meals are defined in Config.register.meals:

-- Example meal configuration
Config.register = {
    meals = {
        ['burger'] = {
            order = 1,                      -- Menu position
            label = 'Burger',               -- Display name
            price = 8.99,                   -- Price
            emoji = 'πŸ”',                   -- Emoji
            image = 'image_url',            -- Meal image
            ingredients = {                -- Required ingredients
                ['bun'] = {
                    label = 'Bun',
                    emoji = '🍞',
                    amount = 1,
                    optional = false
                }
            }
        }
    }
}

Item Types

After adding items, register them in Config.items:

-- Example item type registration
Config.items = {
    ['sprunk'] = 'st_snr_drink',
    ['burger'] = 'st_snr_main',
    ['fries'] = 'st_snr_side',
    ['box'] = 'st_snr_box'
}

Notes

  • Image URLs should be accessible from the game client

  • Emojis should be simple and recognizable

  • Prices should be in USD format (e.g., 8.99)

  • The default quantity is how many items spawn when the server restarts

Last updated