I've recently asked a question on how to change a TextLable to a players rank in a group. It simply wont work the way I found so I am asking again.
TextLable = Ranking game.Players.PlayerAdded:connect(function(player) Ranking.Text("Rank - " .. player:GetRoleInGroup(0)) end)
Can someone help me? This as basic as I can get.
I'm confused as to whether you are just trying to set your rank or everyone who joins. If you're just setting your rank then it'd be something like this:
local textLabel = script.Parent:WaitForChild('TextLabel') local player = game.Players.LocalPlayer textLabel.Text = player:GetRoleInGroup(919349)
If you're trying to set it for everything, (then you'd need to use ChildAdded as PlayerAdded doesn't work in LocalScripts) - edit. I guess PlayerAdded works in LocalScripts now. It'd be something like this, but with your script so that it doesn't change the same TextLabel, but makes a new one and sets it.
local textLabel = script.Parent:WaitForChild('TextLabel') local function setText(player) textLabel.Text = player:GetRoleInGroup(919349) end game.Players.PlayerAdded:connect(function(player) setText(player) end) -- Will catch your player and everyone whom joined before the script ran. for i,v in pairs(game.Players:GetPlayers()) do setText(v) end
function display(player) Ranking.Text = "Rank - " .. player:GetRoleInGroup( ID ) end game.Players.PlayerAdded:connect(display) display(game.Players.LocalPlayer)