Leaderboards are just some IntValue items inside all Players.
02 | Players (Player Service) |
04 | leaderstats (IntValue) |
08 | leaderstats (IntValue) |
12 | leaderstats (IntValue) |
To make one, at the least you need to bind to the PlayerAdded event, which will put the leaderstats object into the player along with the types you want to add, such as KOs, WOs.
Then, you need to bind to whatever events you need to in order to keep track of your leaderstats items, such as binding to humanoids to track when they die, etc etc.
Here's a simple script that will create the initial leaderstats objects, along with a table you can manipulate to set what items you wanna keep track of
1 | local stats = { "KOs" , "WOs" , "Money" } |
3 | game.Players.PlayerAdded:connect( function (player) |
4 | local leaderstats = Instance.new( "Model" , player) |
5 | leaderstats.Name = "leaderstats" |
6 | for _, stat in pairs (stats) do |
7 | Instance.new( "IntValue" , leaderstats).Name = stat |