local NumValues = {
{Name = "XPMultiplier", Value = 1},
{Name = "DEF", Value = 1},
{Name = "DEFXP", Value = 0},
{Name = "STR", Value = 1},
{Name = "STRXP", Value = 0},
{Name = "AGI", Value = 1},
{Name = "AGIXP", Value = 0},
{Name = "Money", Value = 0},
{Name = "PL", Value = 1},
}
for _, tab in NumValues do
local Name = tab.Name
local Value = tab.Value
local NumValue = Instance.new("NumberValue")
NumValue.Name = Name
NumValue.Value = Value
NumValue.Parent = DataFolder
end
Since you only care about 2 unique values here, a string and a number, you could actually simplify this further. Just use a dictionary where the name is the key and the value is… the value. Like this:
local numberValues = {
XPMultiplier = 1,
DEF = 1,
DEFXP = 0,
STR = 1,
STRXP = 0,
AGI = 1,
AGIXP = 0,
Money = 0,
PL = 1,
}
for name, value in pairs(numberValues) do
local numberValue = Instance.new("NumberValue")
numberValue.Name = name
numberValue.Value = value
numberValue.Parent = DataFolder
end
Though I don’t know how this is implemented, another suggestion I can make is to not even bother with number values if you don’t need to. Just use a ModuleScript to store the information in a table, any scripts that need this information can grab it from the ModuleScript. If you don’t know what those are you should definitely look them up!