Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a leaderboard but instead of numbers, it's letters?

Here's the code I have:

local players = game:WaitForChild("Players")

local function createLeaderboard(player)
    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    local rank = Instance.new("IntValue", stats)
    rank.Name = "Rank"
rank.Value = 0 
    stats.Parent = player
end

players.PlayerAdded:connect(createLeaderboard)

Here's the code I want:

local players = game:WaitForChild("Players")

local function createLeaderboard(player)
    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    local rank = Instance.new("IntValue", stats)
    rank.Name = "Guest"   -- I know it's an error.
rank.Value = 0 
    stats.Parent = player
end

players.PlayerAdded:connect(createLeaderboard)

The last code had an error. Could you help me?

3 comments

0

Are you trying to make a leaderboard with group ranks in it?

0

It's not rank.Name, it's rank.Value + IntValue's is for numbers only.

0

You want to use a StringValue

1 answer

✓ Accepted answer

If you want a leaderstats value to have letters, you need a StringValue, not an IntValue. IntValues take whole numbers, while StringValues take strings (or text)

local players = game:WaitForChild("Players")

local function createLeaderboard(player)
    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    local rank = Instance.new("StringValue", stats)
    rank.Name = "Guest"   
    rank.Value = "Guest" -- change "guest" to the rank you want
    stats.Parent = player
end

players.PlayerAdded:connect(createLeaderboard)

This discussion is preserved as it was. New answers, comments, and votes are closed.