Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a multi-leaderstats?

Asked by 4 years ago

Does it have to do with: Cash1 Cash2 Cash3 Cash4 (Max value Cash4)

0
what do you have so far? royaltoe 5144 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Here you are:

game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Parent = player
    leaderstats.Name = "leaderstats"--Make sure it's named "leaderstats" else it won't work

    --Creating the 1st value (Cash1)
    local cash1 = Instand.new("IntValue")
    cash1.Parent = leaderstats
    cash1.Name = "Cash1"--Name it whatever you want cuz the name of the stats is this

    --Creating the 2nd value (Cash2)
    local cash2 = Instand.new("IntValue")
    cash2.Parent = leaderstats
    cash2.Name = "Cash2"--Name it whatever you want cuz the name of the stats is this

    --Creating the 3rd value (Cash3)
    local cash3 = Instand.new("IntValue")
    cash3.Parent = leaderstats
    cash3.Name = "Cash3"--Name it whatever you want cuz the name of the stats is this

    --Creating the 4th value (Cash4)
    local cash4 = Instand.new("IntValue")
    cash4.Parent = leaderstats
    cash4.Name = "Cash4"--Name it whatever you want cuz the name of the stats is this
end)

You must add this SCRIPT (not localscript) in game.ServerScriptService.

You see those variables at line 7, 12, 17 and 22? you can change them to whatever you want, cuz it will not be the name of the stat. They are variables. But if you change those variables, make sure to change the following two lines too! Example: If you change the name of the variable at line 7 to "Money", then you MUST change the variables at line 8 and 9 to "Money" too.

I hope this helped!

Ad

Answer this question