🔧Config

Explanations for all config values.

Having trouble?

If you feel like we have explained any value poorly, please let us know on Discord so that we can update the documentation so that everyone understands it easily.

To understand the structure

Because we have extensive configuration files, nested tables is an inevitability. To keep track of which values are for which table we use the tablename.value. This can also stack, for example location.blip.enabled etc.

Additional Settings

If there is a feature within the script that you can't find in the script's config, there is a chance that the configuration lies within Zyke Lib. This is to ensure that you never have to configure your targeting menu, framework etc over and over again.

Config.GeneralSettings

Basic settings such as debug, cooldowns etc will be configured within here.

debug

Debugging is a development tool used to track values within the resource. If you are experiencing odd issues, we recommend using the debug functionality to have a transparent view of what happens within the script. Utilizing debug can help you spot weird values and easily address the problem.

Example:

-- Set to true to enable, false to disable.
Config.GeneralSettings = {
    debug = false,
}

cooldown

Client-sided feature to prevent unrealistic results such as trapping NPCs to continously rob them etc. Example:

-- In seconds, set it to any number you wish
Config.GeneralSettings = {
    cooldown = 60,
}

changeToFight

When robbing a citizen, unless they are on their knees, there will be a dice roll to see if they will fight back.

Example:

-- Percentage based, give it a value between 0-100
Config.GeneralSettings = {
    chanceToFight = 20,
}

robInVehicles

If set to true, you will be able to rob peds inside of their vehicles. This is made as a setting as some servers' key systems may clash with this, as they allow peds to have the keys robbed and it looks somewhat weird.

Example:

-- Set to true to enable, false to disable.
Config.GeneralSettings = {
    robInVehicles = true,
}

pickupModels

These are the models that will be randomly chosen from as the prop for when a victim drops their loot. Note that if you're using a 3rd eye targeting system, the props needs to have a collision. Models: https://forge.plebmasters.de/objects

Example:

-- Set it to a valid model string, not the hash (number)
Config.GeneralSettings = {
    pickupModels = {"prop_cs_heist_bag_02", "v_ret_ps_bag_02", "prop_big_bag_01", "prop_beach_bag_01b"},
}

specialPeds

To enhance the loot tables, certain ped models can have access to extra loot tables. For example, a gang member can have access to weapons, a hippie to drugs etc. Example:

-- Follow the format below, you can set the ped model as a string or it's hash (number)
-- Make sure that you have the value as a table, then insert your loot table names as strings, as seen below
Config.GeneralSettings = {
    specialPeds = {
        ["s_m_y_cop_01"] = {"policeLoot", "gangLoot"},
        ["ig_claypain"] = {"gangLoot"},
    }
}

blacklistedModels

To prevent unrealistic robberies, this table allows you to blacklist models you wish not to be robbed. Note that animals and normal players are already blacklisted by class, below are individual models such as police, military etc.

Example:

-- Accepts ped model string and ped model hash
-- Note that you can enable and disable peds by setting them to true or false
Config.GeneralSettings = {
    blacklistedModels = {
        ["cs_casey"] = true,
        ["csb_cop"] = true,
        ["csb_mweather"] = false
    }
}

blacklistedRobberyWeapons

If you want to block certain weapons from being able to trigger robberies, add them here. It is recommended to add weapons used by blue light workers, such as weapon_combatpistol, which is often used as a police handgun.

Example:

-- Accepts weapon string and weapon hash
-- Note that you can enable and disable weapons by setting them to true or false
Config.GeneralSettings = {
    blacklistedRobberyWeapons = {
        ["weapon_unarmed"] = true,
        ["weapon_combatpistol"] = true,
        ["weapon_stungun"] = true,
        ["weapon_assaultrifle"] = false,
    }
}

blacklistedRobberyJobs

Just like above, you don't want certain people to trigger robberies. Below you can add any job that you want to restrict robberies from. Can be a more optimized feature for handling blue light jobs than above, but both exist and work together if you would either Example:

-- Accepts the job name (string)
-- Note that the format are a bit different from the ones above
Config.GeneralSettings = {
    blacklistedRobberyJobs = {
        "police",
        "ambulance"
    }
}

alerts

When robbing citizens, police will get alerts if certain values are met, below you can configure them.

Example:

Config.GeneralSettings = {
    alerts = {
        locationType = "zone",
        chance = 50,
        jobs = {
            "police",
        }
    }
}

alerts.locationType

By default there will be two ways police can see ongoing robberies. This is an unlocked function and can easily be switched out to fit your needs. zone This setting will give you a zone / area of the robbery. It will also give you a random offset from the original location, this means that the police may not find you straight away as their blip can be a little off. precise This setting will simply create a blip on the location of the robbery, nothing fancy. Example:

-- "zone" / "precise"
locationType = "zone",

alerts.chance

To not make it too difficult to rob, there is a percentage based chance that the police will not be alterted, which you can easily configure.

Example:

-- A number between 0-100
chance = 50,

alerts.jobs

This is simply a table containing all jobs that will be alerted. This is made in a way to allow for multiple-department servers to all get notified, with ease. Example:

-- Accepts the job name (string)
jobs = {
    "police",
    "police2", -- Example on how to add more jobs
}

signaling

Most of you probably won't edit this, but is available in case you do. This is configuration for the citizen signaling, both upon initiation and to handle the victim. Example:

Config.GeneralSettings = {
    signaling = {
        signalUsingVoice = true,
        keys = {
            {
                name = "signalCitizen", -- Don't touch any names
                key = 38, -- E
                keyName = "~INPUT_PICKUP~", -- E
                func = function() -- Don't touch any functions
                    SignalCitizen()
                end
            },
            {
                name = "sitDown",
                key = 38,
                keyName = "~INPUT_PICKUP~",
                func = function()
                    SitVictimDown()
                end
            },
            {
                name = "dropBelongings",
                key = 47, -- G
                keyName = "~INPUT_DETONATE~",
                func = function()
                    VictimDropBelongings()
                end
            }
        }
    },
}

signaling.signalUsingVoice

With this configuration enabled you can aim at the victim, talk for one second and it will initiate the robbery just like normal signaling. This is to simulate realism and overall a more fun way to use the script, if you feel it fits your server.

Example:

-- true or false
signalUsingVoice true,

signaling.keys[x].name

Do not touch this configuration.

signaling.keys[x].key

This is the key that you press to execute the function func. You can change it to whatever you want. Make sure to also change #signaling-x-.keyname.

Keys: https://docs.fivem.net/docs/game-references/controls/ Example:

-- Set it to any accepted key in the list
key = 47, -- G

signaling.keys[x].keyName

When switching key, this is important to also switch. This is the label that will display top left of your screen, letting your players know which key you can use. Keys: https://docs.fivem.net/docs/game-references/controls/

Example:

-- Set it to any accepted key in the list
keyName = "~INPUT_PICKUP~", -- E

signaling.keys[x].func

Do not touch this configuration.

zyke_gangs

This configuration allows integration of my release zyke_gangs, at the time of making this documentation and releasing zyke_mugging, it will not be available. Since this is a separate release we will not cover the values in here. Upon release of zyke_gangs you can find explanations for the exports [here]. Example:

-- Only enable if you are running zyke_gangs
Config.GeneralSettings = {
    zyke_gangs = {
        enabled = false,
        objectiveProgressionFunc = function(source)
            exports["zyke_gangs"]:AddToObjective({
                name = "robCitizens",
                identifier = source,
                amount = 1,
            })
        end,
        loyaltyRemovalFunc = function(source, pos)
            local gridOwner, grid = GangFuncs.GetGangForGrid(pos)
            if (gridOwner) then
                gridOwner.Functions.RemoveGridLoyalty({
                    id = grid.id,
                    handler = source,
                    amount = "robCitizens",
                    details = {
                        reason = "robCitizens",
                    }
                })
            end
        end,
    }
}

zyke_gangs.enabled

Set to true to enable, false to disable.

Config.Strings

Translations for all available strings for the script.

Config.LootTable

All settings related to the loot tables that are generated.

settings

Basic settings for loot tables.

Example:

Config.LootTable = {
    settings = {
        chanceToAdd = 70,
        itemCap = 3,
        standardLootTables = {
            "random",
            "snacks",
            "technology",
            "tools",
        },
        standardLoot = {
            {name = "cash", amount = {200, 800}, currency = true, formatter = 10},
            {name = "phone", amount = 1},
        },
    },
}

settings.chanceToAdd

Percentage based chance to add an item. A randomizer between 0-100 is created, if it hits within your set value, it will add an item to that loot table, if all other requirements are met such as settings.itemCap and no duplicates.

Example:

-- A 70% chance that an item is added
chanceToAdd = 70,

settings.chanceToHideItem

When robbing a citizen by having them drop the loot themselves, there is a chance that they will hide items they have on them. The chance is for each item, so if the victim has 2 items it will have a 50% of hiding the first item, then a 50% chance of hiding the second item and so on.

Example:

-- 20% chance that an item will be hid
chanceToHideItem = 20,

settings.minimumItems

Settings to ensure item generation for every robbery that occurs.

Example:

settings = {
    minimumItems = {
        amount = 1,
        unaffectedByHideItem = false,
    }
}

settings.minimumItems.amount

If you wish to ensure that there is always at least a set amount of items in a robbery, set this value to that amount of items. It will force the set amount of items to be generated and then the chance for more items will occur. Note that if it is set to a number higher than your itemCap, it will default to your itemCap and not run any chance for more items. It is important to ensure that all your loot tables have at least this amount available for them. If you have a minimum amount of 5 and the loot table only has 2 items, you will at most get those 2 items.

Example:

-- Whole number is required, 1 for 1 guaranteed item, 2 for 2 etc
amount = 1,

settings.minimumItems.unaffectedByHideItem

When a victim drops their belongings, there is a chance that the items in the loot created will be removed. unaffectedByHideItem was created to bypass those calculations if the loot that is about to be dropped is less than or equal to your minimumItems amount. To put it simply, if you set your minimumAmount to 1, having your unaffectedByHideItem set to true will ensure that the items can't be hidden and you always get at least what your minimumAmount is set to. However, if you set unaffectedByHideItem to false, the victim can hide the items and ignores the minimumAmount set.

Example:

-- true or false
unaffectedByHideItem = true,

settings.itemCap

To prevent crazy loottables, there is a max capacity of items that can be generated, simply set this value to what you see fit. Example:

-- Max 3 items
itemCap = 3,

settings.standardLootTables

In here you will add all of the loot tables you want available for all ped models. As seen in specialPeds you can add specific loot tables to models. The loot tables in this list will always be added when generating loot for the victim.

Example:

standardLootTables = {
    "random",
    "snacks",
    "technology",
    "tools",
    -- You can easily add more down here, just follow the format
}

settings.standardLoot

To make life easier we decided to include standard loot that will always have a chance to appear on bodies. Default values are what we deemed would be realistic to always carry, but you can edit this to fit your server's needs.

Example:

standardLoot = {
    {name = "cash", amount = {200, 800}, currency = true, formatter = 10},
    {name = "phone", amount = 1},
    {name = "weapon_knife", amount = 1, weapon = true}, -- Example of weapon, is not added by default in your loot table
}

settings.standardLoot[x].name

The name for your reward. If you're using items, set it to the spawn name of that item, if you're using a currency, set it to the name of the currency. Example:

name = "cash",

settings.standardLoot[x].amount

The amount you wish to receive. You can set it to a whole number or a table containing two numbers. Note that the first number HAS to be smaller than the second one. Using a table and specifying two numbers will randomly choose a number between the two values.

Example:

amount = {200, 800},
-- OR
amount = 400,

settings.standardLoot[x].currency

If you wish to receive the reward as a currency, like you can see with "cash" above, set this value to true. If not, you can either leave it empty or set it to false to use items.

Example:

currency = true,

settings.standardLoot[x].formatter

Formatter simply exists to make the rewards seem more realistic. If we are choosing a random value between 500-1000, you may get something like 723. Using the formatter, if set to 10, it will take your value and divide it by 10 (723 / 10), which gives you 72,3. After this, we will round the number down to the nearest whole number, which is 72 in this case. Then it will take your number and multiply it by your formatter which gives you a much cleaner outpot (72 * 10 = 720). This can also be used for items, but is only recommended to use if you have large quantities of items or you wish to have "stacks" / whole numbers such as 5, 10, 25 etc.

Example:

formatter = 10,

settings.standardLoot[x].weapon

If you wish to receive this item as a weapon, set it to true. Please note that even if you use items for weapons, set it to true if it is a weapon. This is because it relies on Zyke Lib to give you it as an item or weapon. This way you can future proof yourself if there are any changes made. It is not required to do it this way, but heavily recommended.

Example:

weapon = true,

loot

This is where you configure the items and quantity for your loot tables. When generating loot you will randomly select once of these loot tables. And then you will randomly select a more specific loot table within your "category". So for example, it was randomly chosen that you got "random", and then it choose the first table, which consists of "rolex", "goldchain" and "lighter", as well as the default items in settings.standardLoot. Example:

Config.LootTable.loot = {
    ["random"] = {
        {
            {name = "rolex", amount = 1},
            {name = "goldchain", amount = 1},
            {name = "lighter", amount = 1},
        },
        {
            {name = "weapon_knife", amount = 1, weapon = true},
            {name = "goldchain", amount = 1},
        },
        {
            {name = "diamond_ring", amount = 1},
        }
    },
    ["snacks"] = {
        {
            {name = "twerks_candy", amount = {1, 2}},
            {name = "snikkel_candy", amount = {1, 2}},
            {name = "grapejuice", amount = 1},
        },
    },
}

loot[x][x]

There will be no extended explanations for any of these values, as they are already explained in settings.standardLoot.

Last updated