Config
Here is the entire config.lua file
Config = {
--This can either be qb-core or 'custom'.
--Check out server_no_encryption.lua if you need to edit how items and money is given to the player.
item_version = 'qb-core',
--The pickaxe model to spawn when the player is mining a rock
pickaxe_model = `prop_tool_pickaxe`,
--A timer that checks to spawn ores for people in ms. Currently set to 5 minutes, Would not recommend going lower than 3 minutes.
ore_spawn_check_interval = 300000,
--[[
The name of the item that is needed to be able to mine ores.
]]
pickaxe_item_name = 'pickaxe',
--[[
The item name of the mining helmet
If you decide to change this to another pickaxe you must make sure it is set to unique in the qb-core/shared/items.lua file or you will run into problems.
]]
helmet_item_name = 'mining_helmet',
--[[
Gets called every time we check to spawn a ore in one of the locations in Config.spawnpoints.
I would recommend having this at 50 or above.
]]
ore_spawn_chance = 50,-- Number between 0 - 100 (100 means they will always spawn)
--This enables saving of peoples ores, It will create a new file for every person in the 'ore_saves' folder with the persons citizenid as the file name.
enable_ore_save = true,-- true = enabled - false = disabled
--How often to check when a player is mining to see if they should get ore in ms
mining_check_inverval = 5000,
--[[
How many times can the player get ore from the rock before it breaks
This can also be a static number. if you leave it how it is right now it will chose a random number from 3 to 5.
]]
minumum_and_maximum_mines = {3,5},
--[[
The Miner NPC spawn location. He is the first point of contact and should probably stay in this location.
He sells the pickaxe and mining helmet by default.
You can change the prices of these items at the bottom of this file. (Config.miner_items)
]]
miner_spawn_location = vector4(-598.69, 2091.69, 130.39, 328.39),
--The miner and mineshaft blip information
--The blip location is set to Config.miner_spawn_location coords.
miner_blip_info = {
sprite = 414,
display = 6,
scale = 0.85,
colour = 21,
short_range = true,
text = 'Mining | Mine Shaft'
},
--[[
A list of refinery levels.
refines_needed is the amount of refining a player needs to complete before getting the rank. This is the players total refines completed its NOT per rank.
For example rank 1 to rank 2 is 20 refines, It takes another 30 refines to get to rank 3.
extra_bar_chance is a chance to receive a extra bar when refining. (0 - 100)
refinery_time is how long it takes to refine the ore.
rank !IMPORANT! Make sure this goes up in order if you add your own (1,2,3,4,5,6,7, etc)
]]
refinery_levels = {
{refines_needed = 0, extra_bar_chance = 0, rank = 1, refinery_time = 10000},
{refines_needed = 20, extra_bar_chance = 5, rank = 2, refinery_time = 9000},
{refines_needed = 50, extra_bar_chance = 10, rank = 3, refinery_time = 8000},
{refines_needed = 100, extra_bar_chance = 20, rank = 4, refinery_time = 7000},
{refines_needed = 200, extra_bar_chance = 35, rank = 5, refinery_time = 5000},
},
--[[
the location and blip information for the bar/gem purchaser.
You can disable this if you wish by setting enabled to false.
]]
sell_vendor_information = {
enabled = true,
location = vector4(582.29, -2723.26, 6.1, 138.59),
blip = {
sprite = 414,
display = 6,
scale = 0.85,
colour = 2,
short_range = true,
text = 'Mining | Material Purchaser',
}
},
--[[
A list of items that can be sold to the mining vendor
item_name is the item spawn name.
price is the price you want people to get when selling these items.
You can also change them to a math.random() if you wish. (price = math.random(50,100))
Setting it to a math random picks a random number at server start and the price remains the same until the server restarts or the script is restarted.
]]
sellable_items = {
-- Bars --
{item_name = 'copper_bar', price = 50},
{item_name = 'iron_bar', price = 100},
{item_name = 'silver_bar', price = 200},
{item_name = 'gold_bar', price = 300},
{item_name = 'platinum_bar', price = 500},
-- Gems --
{item_name = 'topaz', price = 100},
{item_name = 'sapphire', price = 200},
{item_name = 'emerald', price = 300},
{item_name = 'ruby', price = 600},
{item_name = 'diamond', price = 800},
},
--[[
The items that can be refined
{
item_name = the item that is needed in order to refine,
cost = how much of the item it costs to create the reward,
reward = {
item_name = name of the item that is rewarded when completed,
amount = amount of item to give when completed,
},
other_rewards = {
{
item_name = The item to give
chance = The chance they get the item,
amount = The amount of the item to give.
},--You can add more just like below
{
item_name = The item to give
chance = The chance they get the item,
amount = The amount of the item to give.
},--You can add more below
--The script will chose 1 random item from the table of items.
},--!! You can simple delete this if you don't want a chance to get other items.
},
]]
refine_items = {
{
item_name = 'copper_ore',
cost = 3,
reward = {
item_name = 'copper_bar',
amount = 1
},
other_rewards = {
{
item_name = 'metal_scrap',
chance = 50,
amount = 2
},
},
},
{
item_name = 'iron_ore',
cost = 3,
reward = {
item_name = 'iron_bar',
amount = 1
},
other_rewards = {
{
item_name = 'metal_scrap',
chance = 50,
amount = 2
},
},
},
{
item_name = 'silver_ore',
cost = 3,
reward = {
item_name = 'silver_bar',
amount = 1
},
other_rewards = {
{
item_name = 'metal_scrap',
chance = 50,
amount = 2
},
},
},
{
item_name = 'gold_ore',
cost = 3,
reward = {
item_name = 'gold_bar',
amount = 1
},
other_rewards = {
{
item_name = 'metal_scrap',
chance = 50,
amount = 2
},
},
},
{
item_name = 'platinum_ore',
cost = 3,
reward = {
item_name = 'platinum_bar',
amount = 1
},
other_rewards = {
{
item_name = 'metal_scrap',
chance = 50,
amount = 2
}
},
},
},
--Refinery locations + blip settings.
refinery_info = {
locations = {
{
location = vector3(1086.38, -2003.69, 31.42),
length = 4.3,
width = 3,
heading = 319,
minz = 29.0,
maxz = 32.22,
},
{
location = vector3(1111.88, -2009.57, 31.14),
length = 4.3,
width = 3,
heading = 54.65,
minz = 28.0,
maxz = 34.22,
},
},
--The blip will be placed at the first location in the locations table above.
blip = {
sprite = 414,
display = 6,
scale = 0.85,
colour = 47,
short_range = true,
text = 'Mining | Refinery'
},
},
--[[
The distance of which ore should get a outline
{helmet_exp = helmet experience needed, glow_distance = how close player must be for ore to glow},
Distance can also be a decimal (10.5)
gem_chance is the chance to get a gem, can be 0 - 100 (10 = 10% chance of gem)
]]
helmet_upgrades = {
{helmet_exp = 0, glow_distance = 0, gem_chance = 5},
{helmet_exp = 60, glow_distance = 10, gem_chance = 10},
{helmet_exp = 120, glow_distance = 15, gem_chance = 20},
{helmet_exp = 400, glow_distance = 25, gem_chance = 30},
},
--[[
The levels people can obtain with effects.
ores_needed is how many ores people need to mine before getting the rank. Keep in mind this is everytime the person is given a item it will reward them with a ore.
so by default they can get 3 to 5 ores mined each rock.
helm_experience Adds experience to your helmet, Each helmet has metadata and at certain exp thresholds set in Config.helmet_upgrades they get different bonuses.
mine_chance gets checked every Config.mining_check_inverval to see if they should get a piece of ore.
If you add a new one make sure they stay in order of ores_needed being in the correct place lowest number at the top and highest number at the bottom.
]]
levels = {
{ores_needed = 0, rank = 1, helm_experience = 2, mine_chance = 45},
{ores_needed = 60, rank = 2, helm_experience = 4, mine_chance = 55},
{ores_needed = 210, rank = 3, helm_experience = 6, mine_chance = 65},
{ores_needed = 510, rank = 4, helm_experience = 8, mine_chance = 80},
{ores_needed = 1000, rank = 5, helm_experience = 20, mine_chance = 100},
},
--[[
These are the models used for the ores found in Config.allowed_ores
If you add your own make sure the model actually exists.
Check out https://forge.plebmasters.de/objects if you do not know how to make your own models you can find gta default models there.
]]
ore_models = {
['copper'] = `minable_copper`,
['iron'] = `minable_iron`,
['silver'] = `minable_silver`,
['gold'] = `minable_gold`,
['platinum'] = `minable_platinum`,
},
--[[
The player will be notified with the string when prospecting the ore.
[`ModelNameHere`] = 'string here telling the player what the rock contains'
]]
prospect_strings = {
[`minable_copper`] = 'This rock contains copper.',
[`minable_iron`] = 'This rock contains iron.',
[`minable_silver`] = 'This rock contains silver.',
[`minable_gold`] = 'This rock contains gold.',
[`minable_platinum`] = 'This rock contains platinum.',
},
--[[
This is associated with ranks
So at rank one you can only spawn copper.
Rank two you have a 45% chance to spawn copper and a 100% chance to spawn iron if the copper does not spawn.
[rank here] = {
{ore = 'orename', chance = (0 - 100)},
{ore = 'orename', chance = (0 - 100)},
},
Keep in mind if you add more of these you will have to create your own custom rocks and att them to Config.ore_models
If you do add your own make sure there is always a chance to spawn a ore.
You can also set the ore to 'none' if you want another chance for it to be nothing, When a ore is set to 'none' a timer starts and after 5 mins another ore could spawn.
]]
allowed_ores = {
[1] = {
{ore = 'copper', chance = 100},
},
[2] = {
{ore = 'copper', chance = 45},
{ore = 'iron', chance = 100},
},
[3] = {
{ore = 'copper', chance = 25},
{ore = 'iron', chance = 45},
{ore = 'silver', chance = 100},
},
[4] = {
{ore = 'copper', chance = 15},
{ore = 'iron', chance = 40},
{ore = 'silver', chance = 45},
{ore = 'gold', chance = 100},
},
[5] = {
{ore = 'copper', chance = 10},
{ore = 'iron', chance = 30},
{ore = 'silver', chance = 40},
{ore = 'gold', chance = 50},
{ore = 'platinum', chance = 100},
},
},
--[[
The rewards for mining the type of model
Gems are the type of gems you can get and it will chose a random one from all the options to give.
If you want a specific gem to be more common than others simple just add another of the same like so
gems = {
'topaz',
'topaz',
'topaz',
'sapphire',
},
This would give topaz a 75% chance and sapphire a 25% chance.
If you don't want a chance of gems just remove it the end product should look something like this:
[`minable_copper`] = {
ore = 'copper_ore',
},
]]
rock_model_rewards = {
[`minable_copper`] = {
ore = 'copper_ore',
gems = {
'topaz',
}
},
[`minable_iron`] = {
ore = 'iron_ore',
gems = {
'sapphire',
}
},
[`minable_silver`] = {
ore = 'silver_ore',
gems = {
'emerald',
}
},
[`minable_gold`] = {
ore = 'gold_ore',
gems = {
'ruby',
}
},
[`minable_platinum`] = {
ore = 'platinum_ore',
gems = {
'diamond',
}
},
},
--[[
The spawn points for ores in the mining area
{location = vector4(X, Y, Z, HEADING), obj = nil},--leave obj as nil
]]
spawnpoints = {
{location = vector4(-590.87640380859, 2076.3359375, 131.57113647461, 4.2495703697205), obj = nil},
{location = vector4(-594.20849609375, 2075.9089355469, 131.22859191895, 203.49725341797), obj = nil},
{location = vector4(-591.91522216797, 2065.9226074219, 131.57795715332, 203.49725341797), obj = nil},
{location = vector4(-588.65942382813, 2067.5949707031, 131.56243896484, 356.24722290039), obj = nil},
{location = vector4(-587.19244384766, 2059.2297363281, 131.14874267578, 0.0), obj = nil},
{location = vector4(-589.35681152344, 2049.6516113281, 130.23599243164, 207.74909973145), obj = nil},
{location = vector4(-587.39154052734, 2043.7175292969, 129.34371948242, 207.74909973145), obj = nil},
{location = vector4(-583.11444091797, 2043.3537597656, 128.9691619873, 22.749086380005), obj = nil},
{location = vector4(-576.61065673828, 2032.6971435547, 128.52705383301, 22.749086380005), obj = nil},
{location = vector4(-580.15313720703, 2031.2576904297, 128.37727355957, 222.24664306641), obj = nil},
{location = vector4(-572.68371582031, 2022.3809814453, 127.39375305176, 222.24664306641), obj = nil},
{location = vector4(-565.96173095703, 2020.642578125, 128.47691345215, 29.246667861938), obj = nil},
{location = vector4(-562.74609375, 2011.5212402344, 126.62102508545, 250.49365234375), obj = nil},
{location = vector4(-554.48883056641, 1998.7686767578, 126.68842315674, 250.49365234375), obj = nil},
{location = vector4(-548.84216308594, 1996.3182373047, 126.8030166626, 4.4928307533264), obj = nil},
{location = vector4(-547.06097412109, 1984.7376708984, 126.78515625, 205.49206542969), obj = nil},
{location = vector4(-543.74456787109, 1987.9411621094, 127.11943817139, 357.74127197266), obj = nil},
{location = vector4(-539.60473632813, 1984.3697509766, 127.143409729, 50.0), obj = nil},
{location = vector4(-541.84326171875, 1979.6520996094, 126.44749450684, 56.490097045898), obj = nil},
{location = vector4(-541.24847412109, 1974.3026123047, 127.18727874756, 346.48999023438), obj = nil},
{location = vector4(-544.48919677734, 1971.0283203125, 126.97342681885, 187.48941040039), obj = nil},
{location = vector4(-543.97546386719, 1966.1387939453, 127.31785583496, 187.48941040039), obj = nil},
{location = vector4(-540.24249267578, 1965.8719482422, 126.74588775635, 24.238611221313), obj = nil},
{location = vector4(-539.384765625, 1958.6680908203, 126.82205963135, 355.2385559082), obj = nil},
{location = vector4(-537.81896972656, 1951.0200195313, 126.28937530518, 355.2385559082), obj = nil},
{location = vector4(-541.44555664063, 1951.1285400391, 126.0347442627, 213.2384185791), obj = nil},
{location = vector4(-538.69262695313, 1940.72265625, 125.66091918945, 213.2384185791), obj = nil},
{location = vector4(-537.88043212891, 1936.5716552734, 125.37459564209, 213.2384185791), obj = nil},
{location = vector4(-536.88745117188, 1926.6097412109, 124.49458312988, 213.2384185791), obj = nil},
{location = vector4(-537.22503662109, 1922.0606689453, 124.24490356445, 213.2384185791), obj = nil},
{location = vector4(-539.13421630859, 1904.2568359375, 122.80853271484, 246.48791503906), obj = nil},
{location = vector4(-534.37017822266, 1901.2503662109, 122.99401855469, 233.9873046875), obj = nil},
{location = vector4(-529.68585205078, 1898.3050537109, 123.62970733643, 233.9873046875), obj = nil},
{location = vector4(-520.30816650391, 1893.9097900391, 122.47898864746, 233.9873046875), obj = nil},
{location = vector4(-507.77337646484, 1895.3659667969, 121.46258544922, 65.986663818359), obj = nil},
{location = vector4(-493.59783935547, 1895.6296386719, 120.69076538086, 65.986663818359), obj = nil},
{location = vector4(-490.18765258789, 1895.9974365234, 120.50742340088, 65.986663818359), obj = nil},
{location = vector4(-486.84707641602, 1896.1619873047, 120.35974884033, 65.986663818359), obj = nil},
{location = vector4(-483.2268371582, 1896.5363769531, 120.12619018555, 65.986663818359), obj = nil},
{location = vector4(-484.43045043945, 1893.0419921875, 119.50507354736, 263.98577880859), obj = nil},
{location = vector4(-489.15548706055, 1892.5570068359, 120.19312286377, 263.98577880859), obj = nil},
{location = vector4(-492.47674560547, 1892.0479736328, 120.76776123047, 297.98452758789), obj = nil},
{location = vector4(-562.88946533203, 1885.4411621094, 123.32366943359, 297.98452758789), obj = nil},
{location = vector4(-560.58093261719, 1886.5705566406, 122.31272125244, 297.98452758789), obj = nil},
{location = vector4(-563.38110351563, 1889.1086425781, 122.95755767822, 119.23176574707), obj = nil},
{location = vector4(-555.68957519531, 1893.8640136719, 123.58882904053, 119.23176574707), obj = nil},
{location = vector4(-544.43389892578, 1904.0288085938, 123.61797332764, 119.23176574707), obj = nil},
{location = vector4(-534.00500488281, 1982.7879638672, 127.40776824951, 55.231346130371), obj = nil},
{location = vector4(-518.60736083984, 1980.8778076172, 126.63512420654, 130.231346130371), obj = nil},
{location = vector4(-505.08898925781, 1980.8801269531, 126.40354919434, 130.231346130371), obj = nil},
{location = vector4(-497.38891601563, 1982.7097167969, 125.79953765869, 130.231346130371), obj = nil},
{location = vector4(-489.01858520508, 1986.3940429688, 124.84654998779, 130.231346130371), obj = nil},
{location = vector4(-476.14541625977, 1990.6853027344, 124.13991546631, 95.981109619141), obj = nil},
{location = vector4(-468.76754760742, 1994.2607421875, 123.89931488037, 95.981109619141), obj = nil},
{location = vector4(-449.40075683594, 2031.7381591797, 123.56015014648, 14.980181694031), obj = nil},
{location = vector4(-452.00817871094, 2040.8795166016, 123.58527374268, 16.730136871338), obj = nil},
{location = vector4(-458.81610107422, 2054.4064941406, 122.44327545166, 50.0), obj = nil},
{location = vector4(-450.98272705078, 2053.9616699219, 122.16990661621, 286.72906494141), obj = nil},
{location = vector4(-434.50045776367, 2060.0368652344, 121.63283538818, 286.72906494141), obj = nil},
{location = vector4(-431.77984619141, 2060.8620605469, 121.53118896484, 286.72906494141), obj = nil},
{location = vector4(-427.05975341797, 2061.8630371094, 121.26219940186, 286.72906494141), obj = nil},
{location = vector4(-423.73342895508, 2062.7380371094, 120.50537109375, 286.72906494141), obj = nil},
{location = vector4(-424.99206542969, 2066.1530761719, 120.35401916504, 86.728157043457), obj = nil},
{location = vector4(-427.66485595703, 2065.6071777344, 119.89398956299, 86.728157043457), obj = nil},
{location = vector4(-466.72424316406, 2071.9895019531, 120.33860778809, 50.0), obj = nil},
{location = vector4(-467.51739501953, 2074.865234375, 121.09603881836, 50.0), obj = nil},
{location = vector4(-468.88751220703, 2080.5837402344, 120.53313446045, 50.0), obj = nil},
{location = vector4(-470.17349243164, 2087.4809570313, 120.20896911621, 50.0), obj = nil},
{location = vector4(-474.6142578125, 2089.5427246094, 119.44631195068, 186.72691345215), obj = nil},
{location = vector4(-473.95391845703, 2087.5954589844, 120.29135894775, 186.72691345215), obj = nil},
},
}
--[[
You can add more items here if you want the miner to sell them.
{item_name = ItemSpawnNameHere, price = YourPriceHere},
]]
Config.miner_items = {
{item_name = Config.pickaxe_item_name, price = 500},--pickaxe price
{item_name = Config.helmet_item_name, item_info = {experience = 0}, price = 500},--mining helmet price !!REQUIRED: This requires the field `item_info = {experience = 0}`!!
}
Last updated