Hello I’m trying to achieve making a Group rank leader board basically in short in our game there is different ranks and whatever rank you are in the group you will be assigned to based on the team name from within the group. so far I have got a leader board that gives your rank from within the roblox group through the Id. But am stuck as how I am suppose to link the leaderboard to the teams in Roblox studio
I have tried looking up things to help me such as Player connected functions and things but If i can get some assistance with what I need to do that would help. Thank you.
The easiest way to do this is to first add a value in the player leaderstats to called rank. You could then use the GetRoleInGroup to get the name of the players rank and then display it in the leaderboard. Your script would look something like this:
local groupID = 12321313 --- ID of the group
game.Players.PlayerAdded:Connect(function(plr)
local ldr = instance.new('Folder',plr) -- Creating the leaderstats
ldr.Name = 'leaderstats'
local Val = instance.new('StringValue',ldr) -- Creating the value Rank
Val.Name = 'Rank'
Val.Value = tostring(plr:GetRoleInGroup(groupID)) -- Setting the value to the players group rank
end)
This would display the players rank name in the leaderboard
Okay so I have managed to make my leaderboard but am now trying to make it so players in my group are put into their respective teams how can I go about doing that? at the moment it defaults me as a student.