Configuration

With all of our resources, you also get much configuration, here is some explanation for it!

INFO: Config might contain BETA additions, so it might not be 1:1 as yours

Config Example

Here you can see a config.lua example with all additions you'll need

With this script you can configure everything! See for yourself!

```lua
Config = {}

--[[
    export.pls_addiction:openMenu()
    export.pls_addiction:addAddiction("effect_name", 1)
    export.pls_addiction:removeAddiction("effect_name", 1)
]]--

-- If you restart the script while the server is online.
-- Is a relog needed?
Config.RequireRelogForLoadAfterScriptRestart = false -- The longest variable name I've created.

Config.AddictionCommand = "addictions" -- or export.pls_addiction:openMenu()
Config.AddictioNotifyTitle = "Addictions"
Config.Debug = true -- Allow debug and cmd = /triggeraddict and /addaddict

-- What does that mean?
-- Every X minutes a timer will run to check for dependencies and apply the effect if necessary.
Config.AddictionTimeLoop = 15 --  Minutes

-- Chance of effect by Addiction
Config.AddictionChanceEffect = 100

Config.AddictStageTime = 30 -- Seconds
Config.Addictions = {
    ----------- FIST ADDICTION START --------------------
    {
        label  = "Cigarette",
        name = "cigar", -- UNIQ NAME
        description = "Cigaretes addiction.",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        color = "red",
        usable = {
            items = {"garbage", "cigarredwood"}, -- or use export.pls_addiction:addAdiction("cigar", value)
            addByUse = 2,
            afterUse = function()
                lib.notify({title="Cigar", description="You smoked cigar", type="inform"})
            end,
            anim = {
                anim = {
                    dict = 'amb@world_human_smoking@male@male_a@enter',
                    clip = 'enter'
                },
                prop = {
                    model = joaat("prop_sh_cigar_01"),
                    pos = vec3(0.03, 0.03, 0.02),
                    rot = vec3(0.0, 0.0, -1.5)
                },
                progressTime = 8000,
            }
        },
        stages = {
            {
                startValue  = 20, -- Required addiction for this stage
                removeAddict = 1, -- This is the number it takes during the effect.
                addictTimeMultiplier = 3, -- Random 1 - 3 for multiply 
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 40,  -- Required addiction for this stage
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 70,
                removeAddict = 1, -- This is the number it takes during the effect.
                effectMultipler = 3, -- How many times / minute
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,

                }
            },

        },
    },
    ----------- FIST ADDICTION END --------------------

    ----------- --------------------
    {
        label  = "Cocaine",
        name = "cocaine", -- UNIQ NAME
        description = "Your cocaine addiction.",
        color = "blue",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"coke_pure"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 60,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = true,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = false,
                }
            },

        },
    },


    {
        label  = "Weed",
        description = "Your marijuana addiction.",
        name = "weed", -- UNIQ NAME
        color = "green",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"coke_pure"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },

        },
    },

    -------------------------------


    {
        label  = "Meth",
        description = "Your meth addiction.",
        name = "meth", -- UNIQ NAME
        color = "lightblue",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"coke_pure"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },

        },
    },

    -------------------------------

    {
        label  = "Crack",
        description = "Your crack addiciton.",
        name = "crack", -- UNIQ NAME
        color = "black",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"crack"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    longfadeout = false,
                    shivering = false,
                    die = false,
                    mentalbrakedown = false,
                    unconscious = false,
                    randomsounds = false,
                    grayfilter = false,
                    cameraflash = false,
                    drugsin = true,
                }
            },

        },
    },

    

    -------------------------------


    {
        label  = "Heroin",
        description = "Your heroin addiciton.",
        name = "heroin", -- UNIQ NAME
        color = "lightgreen",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"heroin"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = true,
                    die = true,
                }
            },

        },
    },


    {
        label  = "Coffe",
        description = "Some coffe",
        name = "coffee", -- UNIQ NAME
        color = "brown",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"coffe"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache =false,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = true,
                    die = false,
                }
            },

        },
    },


    {
        label  = "Sex",
        description = "Oh.. You dirty bastard..",
        name = "sex", -- UNIQ NAME
        color = "pink",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"condom"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache =false,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = true,
                    die = false,
                }
            },

        },
    },


    {
        label  = "Extasy",
        description = "Partyyy",
        name = "extasy", -- UNIQ NAME
        color = "cyan",
        defaultValue = 0, -- This is the value that every player has at the beginning.
        usable = {
            items = {"extasy"}, -- or use export.pls_addiction:addAdiction("cocaine", value)
            addByUse = 2,
        },
        stages = {
            {
                startValue  = 20,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = true,
                    falling = false,
                    screenblur = false,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 50,
                removeAddict = 1, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache = false,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = false,
                    die = false,
                }
            },
            {
                startValue  = 80,
                removeAddict = 0, -- This is the number it takes during the effect.
                effects = {
                    drunk = false,
                    headache =false,
                    falling = false,
                    screenblur = true,
                    fadeout = false,
                    shivering = true,
                    die = false,
                }
            },

        },
    },
}

-- Remove addiction
Config.AntiAddictions = {
    {
        label = "Nicotine patches",
        name = "nicotine_patches", -- UNIQ NAME
        forAddction = "cigar",
        usable = {
            items = {"nicotine_patches"},
            removeByUse = 2,
            afterUse = function()
                
            end,
            anim = {
                anim = {
                    dict = 'mp_player_inteat@burger',
                    clip = 'mp_player_int_eat_burger'
                },
                prop = {},
                progressTime = 3000,
            }
        }
    }
}
```

Last updated