FireConfig = { -- i am trying to access the fireconfig table to change the firerate
FireRate = 360,
InternalMag = false,
InternalMagSize = 0,
CanOneInTheChamber = false,
Damage = 17,
BurstCount = 3,
PelletCount = 1,
MuzzleVelocity = 1050,
DamageFallOff = {
StartsAt = 90,
LowestAt = 150,
FinalMod = 0.2353
}
}
-- gun mods functions
local function modgun(gun, property, mult)
if guns.apply_to_all ~= true then
if gun and property and mult then
if type(mult) == 'number' then
guns.data[gun][property] = guns.copydata[gun][property] * mult
elseif type(mult) == 'boolean' then
guns.data[gun][property] = mult
elseif type(mult) == 'string' then
guns.data[gun][property] = mult
end
end
else
for i, _ in next, guns.data do
if guns.data[i][property] then
if type(mult) == 'number' then
guns.data[i][property] = guns.copydata[i][property] * mult
elseif type(mult) == 'boolean' then
guns.data[i][property] = mult
elseif type(mult) == 'string' then
guns.data[i][property] = mult
end
end
end
end
end
-- how do I call to change the FireRate
modgun(guns.gunname, 'FireRate', (value_firerate)) -- how do I correctly access the fireconfig table which has the value of firerate?
COMMUNITY QUESTION
How would I correctly access this table?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
I think I'm gonna need a bit more specification
So on line 46 I am attempting to change the FireRate however, I can because I am incorrectly calling the FireRate since it's in FireConfigs table using the function I have how would I correctly change the FireRate
FireConfig['FireRate'] = insert number here, access the table by simply writing the table, index stuff inside using brackets [ and ], put a string of what you are indexing, in this case you are getting FireRate then use equal to and set to a value.
You could use rawset, idk I'm checking the script its perfectly fine.