Page cover

πŸ₯˜Consumables

  • The script has an inbuilt consumable system allowing players to eat or drink items and replenish hunger or thirst values

  • Consumable items can give effects various effects such as increased alcohol count, stress reduction, armour boost or a health boost

  • Consumable items can also be set to have a return item e.g. an empty plastic bottle from consuming bottled water

To add more consumables simply define the item name as the key in the consumables.lua file and then the other relevant information such as progressCircle duration and animation and prop values



Config.Restaurant_Consumables = {
    ['my_custom_item'] = {
        info = {
            replenish = 'thirst', -- type of metadata to replenish hunger or thirst
            amount = math.random(20,30), -- amount to replenish
            effects = { -- define effects given stress relief, armour or health
                alcoholCount = 0, -- alcohol level from consuming this item - set to 0 for nothing
                stress = math.random(5,10), -- set to 0 for nothing
                armour = math.random(5,10), -- set to 0 for nothing
                health = math.random(5,10),  -- set to 0 for nothing 
            },
        },
        progress = {
            duration = 5000, -- progressCircle duration
        },
        returned = {
            active = false, -- activates a return item from this consumable item
            item = '', -- the name of the item that is returned when this consumable item is used
        },
        anim = {
            dict = 'mp_player_intdrink', -- name of anim dict used
            anim = 'loop_bottle', -- name of anim used
            flag = 49,  -- flag number
            props = { -- prop settings
                model = 'vw_prop_casino_water_bottle_01a',  -- name of prop model used
                bone = 60309, -- bone index used
                pos = vec3(0.0, 0.0, -0.05), -- vec3 value for prop position
                rot = vec3(0.0, 0.0, -40), -- vec3 value for prop rotation
            },
        },
    },
    --other consumable items
}

Last updated