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

Leaderboard Name Tags?

Hello. I'm trying to figure out how give peoples names on the leader board tags.

E.G. Player name is "Player1". They are rank "General". On the leaderboard the name would appear as "General Player1".

I know how to add stats like this:

game.Players.PlayerAdded:connect(function()
	local stats = Instance.new("IntValue", plr)
	stats.Name = "leaderstats"
	
	local money = Instance.new("IntValue", stats)
	money.Name = "Money"

end)

but I've yet to find a way to create surnames or tags to the player names. Any help with this?

1 answer

There are two ways to do this -

1) Make a leaderstat for their role

2) Make a custom leaderboard

2 is more difficult and more in depth but it will most likely give you a better end product as well as easier configuration.. but it's a bit broat to answer how you make a custom leaderboard so i'll explain 1.

Make a leaderstat named 'Role' and use the GetRoleInGroup method for the value of the stat.

local groupID = 0000000 --Your group ID
local NotInGroup = 'Supporter' --What they'll be if they're not in the group

game.Players.PlayerAdded:connect(function()
	local stats = Instance.new("IntValue", plr)
	stats.Name = "leaderstats"

	local money = Instance.new("IntValue", stats)
	money.Name = "Money"

	local role = Instance.new('StringValue',stats)
	role.Name = 'Role'
	role.Value = plr:GetRoleInGroup(groupID) or NotInGroup
end)

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