Text label not displaying rank

The title says it all.

For some reason, my script to show a players’ rank inside my group isn’t working.

It just doesn’t display their rank on the text label.

image
image

Script: (This is the local script shown in the first screenshot named rank)

local groupid = 11954854
local label = script.Parent

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function()
		wait(2)
	label.Text = "Rank: "..plr:GetRoleInGroup(groupid)
	end)
end)
1 Like

Replace:

with:

local groupid = 11954854
local label = script.Parent
local plr = game.Players.locaplayer
label.Text = "Rank: "..plr:GetRoleInGroup(groupid)
1 Like

This didn’t work
image

add a print so use:

local groupid = 11954854
local label = script.Parent
local plr = game.Players.locaplayer
 local rank = plr:GetRoleInGroup(groupid)
print(rank)
label.Text = "Rank: "..rank

let me know if it prints the rank or not

Nothing printed
thank you for responding

just to confirm this script is deffenately local correct? i do not see a reason it should execute if so.

Yes, it is definitely a local script.

maybe try putting a print at the very top of the script and if that does not work then i am not sure, maybe restart studio?

I see why it didn’t work.

You put “locaplayer” instead of “LocalPlayer” in the script you gave me
image

I replaced it with LocalPlayer and it works
image

Sorry I am not in studio when i typed that and forgot to capitalize that… my mistake…

Discord: kieranl29_#3816

Thank you for helping, your reply was marked as the solution!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.