FortyyRBLX
(FortyRBLX)
November 10, 2021, 11:26pm
#1
So I am trying to make a rank spot that is connected to a group but every time I do that it does not work at all and Idk what other scripts to use since its a custom Leaderboard
Screen shots for info
Thats what the UI looks like I wanna replace “Coal” and have that were the rank will be
Relukn
(Nickk)
November 10, 2021, 11:40pm
#2
You can set the rank text to their rank in a group with :GetRoleInGroup() .
Clone.Rank.Text = Player:GetRoleInGroup(Group_ID)
Also, I’d recommend using .Changed to figure out when to change the coal value, as this is more efficient that a while wait loop.
local players = game:GetService("Players")
local groupId = 2 --change to group id
players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local groupRank = Instance.new("StringValue")
groupRank.Name = "Rank"
groupRank.Parent = leaderstats
groupRank.Value = ""
player.CharacterAdded:Connect(function(character)
local groupRole = player:GetRoleInGroup(groupId)
groupRank.Value = groupRole
end)
end)
Really simple to achieve this, just change this slightly so it fits your game.
1 Like