I’m guessing you just want another row called “Miles” on the leaderboard, so you just need to create a new folder, call it “Miles” and then parent it to the leaderstats.
local m = Instance.new("Folder")
m.Name = "Miles"
m.Parent = leaderstats
Edit: It should be a IntValue or a StringValue, not a Folder.
local m = Instance.new("IntValue")
m.Name = "Miles"
m.Parent = leaderstats
Just to expand on your point:
The Developer Hub has an article about leaderboards.
Also, you should probably not have 2 variables called the same thing:
local currency = Money
local currency2 = milage
The above is probably A better option in Any situation involving variables.
If you want you could just put this script in the “SeverScript Service”
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Money"
Money.Value = 0
Money.Parent = leaderstats
local miles = Instance.new("IntValue")
miles.Name = "Miles"
miles.Value = 0
miles.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
You can put them in the same script as seen above.
Edit: You can also connect the values to the same datastore or different ones(both of which can be done in the same script.)
It works thank you guys so much… This is literally the first script I didn’t ask where line do I put the script on and where do I put it. Thanks for leading me on right path!!