I don’t know how to condense this into a function because it doesn’t let me put the Name value into the function. I want to edit the Value, Name, and the Value Type(IntValue, StringValue, etc) of the function
You can compress everything into a function as shown above or you can automate it as below. It all depends on what is more convenient for you.
local Objects = {
Coins = {
Class = "IntValue",
Value = 0
},
Gems = {
Class = "IntValue",
Value = 0
},
Exp = {
Class = "IntValue",
Value = 1
},
Tier = {
Class = "IntValue",
Value = 1
},
Equipped = {
Class = "IntValue",
Value = 1
},
Level = {
Class = "IntValue",
Value = 0
}
}
local leaderstats = {}
for Key, Object in Objects do
local New = Instance.new(Object.Class)
New.Name, New.Value, New.Parent = Key, Object.Value, leaderstats
end