Hi, I am doing a rpg game right now, and my weapons system it’s like this, since i you can’t obtain them normally (on the floor, things like that), but by a Module Manager i have, i got this :
-- itemNameHereInfo.lua
return {
id = "1",
name = "Sword",
itemType = "Weapon", -- ranged.. -- consumable
damage = 20, --
maxAmmo = 30 --
}
-- playerData
{
["123"] = {
bonusDamage = 5 -- player bought an upgrade to their weapon which boosts damage
-- more values here, like the one above or changing the name , how would i add more custom values ? (ex. "bonusAmmo")
}
}
So yeah, the question is how to add values to a already made table
i tried doing things like :
["123"].bonusAmmo = 25 , but it throws nil