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

Need help with creating the leaderstat group thingy?

I would like to create a script for my game. The function of the script is whenever someone in my group join the game it will list on the top-right leader stat I would like to beable to customize it for a example the role is called "[REC] Recruit" I would like it to say REC on the leaderstat.

if someone can help me do that or create a script for me that would be nice.

1 answer

With leaderboards, you have to connect them when a player joins. So, you would use the PlayerAdded function. Then, you must create a value inside the player and call it "leaderstats". -- Has to be lowercase and spelled right.

It would look something like this.

function makeLeaderstats(player)
	local LS = Instance.new("IntValue") 
	LS.Parent = player
	LS.Name = "leaderstats"
end

game.Players.PlayerAdded:Connect(function(player)
	makeLeaderstats(player)
end)

Then, when you do that, you can make another value inside the leaderstats value and set its name and then the value to their rank by using GetRoleInGroup from the player.

If you're confused, look at the leaderboard section.

1 comment

0

i keep seeing people do ways that take, longer, you don't have to make a function() then a Connect(function(), you can just do Connect(function(player)

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