How would I do a group string value in a leaderboard.
For example, in my military group I would like it to show if a person is in multiple regiments,
How would I do a group string value in a leaderboard.
For example, in my military group I would like it to show if a person is in multiple regiments,
What is a “regiment”? Is it a separate group entirely or a separate rank in your group?
If you want to show the players rank in one group, you can use the Player:GetRoleInGroup(GroupId)
function and put it in a StringValue named “Rank” in a folder named “leaderstats” inside of the player.
A regiment is a subgroup.
I already have the main rank leaderstat but am looking for a way for the leaderboard to, if player is in multiple subgroups, display all of them.
For example, if player is in 3 subgroups it would display all three in that leaderboard. (They will be acronyms)
I would recommend not doing this, as your leaderboard would get very messy very quickly. Perhaps look into creating a nametags script that can display this information below their username.
Finding which regiments a player is in is just a matter of checking if their rank is not equal to “Guest”, and if it isn’t, display it. (You could also check rank ID but by checking name you save an API request)
Edit: Look into GroupService:GetGroupsAsync() instead, it is a great alternative that I had forgotten about
Is it possible to do though?
It would be displayed as “ETS RMP GG” etc. They are just some of the names of the subgroups.
Yes, it is possible. Using the GroupService:GetGroupsAsync() I linked above, you can get the users groups and then check the group IDs against a preset list of your regiment group IDs. If matches are found, then add them to the leaderboard.