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

Leaderboards

Asked by
alibix123 175
10 years ago

How do I start on making one? Do I tag a killer and add a number for every time the killer has killed? How do I show this on a leaderboard?

0
thank you i was doing it all wrong i tried for 2 days to make this and it was annoying as heck thank you this really helped me even if it was from 6 years ago PuewoThePuro 0 — 4y

2 answers

Log in to vote
3
Answered by
Bubby4j 231 Moderation Voter
10 years ago

Leaderboards are just some IntValue items inside all Players.

game (DataModel)
    Players (Player Service)
        Player1
            leaderstats (IntValue)
                KOs (IntValue)
                WOs (IntValue)
        Player2
            leaderstats (IntValue)
                KOs (IntValue)
                WOs (IntValue)
        Player3
            leaderstats (IntValue)
                KOs (IntValue)
                WOs (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

local stats = {"KOs", "WOs", "Money"}

game.Players.PlayerAdded:connect(function(player)
    local leaderstats = Instance.new("Model", player)
    leaderstats.Name = "leaderstats"
    for _, stat in pairs(stats) do
        Instance.new("IntValue", leaderstats).Name = stat 
    end
end)
0
Wow this just blew my mind I thought leader boards are using a service O.O MessorAdmin 598 — 10y
Ad
Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

Well, noticing that you seem to be a Beginner, I'd recommend using the [url=http://www.roblox.com/Leaderboard-item?id=53310]ROBLOX Leaderboard[/url]

Answer this question