Help with group rank script

Basically, I am trying to make a GUI where only group members can see, based on your rank in the group it will change the TextLabel Text, for example if you are the first rank in the group, the TextLabel will say Basic Member. It is mainly just an admin panel.

The textlabel will not change to the assigned name.

I have tried all solutions possible, checked the developer hub and asked a few friends, I still am not able to find a solution.

Here is the script:

local plr = game.Players.LocalPlayer

game.Players.PlayerAdded:Connect(function(Player)
	if plr:GetRankInGroup(xxxxxxx) == 1 then
		script.Parent.Text = "Basic Membership"
	elseif
		plr:GetRankInGroup(xxxxxxx) == 2 then
		script.Parent.Text = "Premium Membership"
	elseif
		plr:GetRankInGroup(xxxxxxx) == 3 then
		script.Parent.Text = "Administrator"
	elseif
		plr:GetRankInGroup(xxxxxxx) == 255 then
		script.Parent.Text = "Founder"
	else
		script.Parent.Text = "!Blacklist Detected!"
		wait(3)
	plr:Kick("Tried to load GUI without permission!")
	
	
	end
end)

Here is the positions:

image

Thank you!

2 Likes

this will only check after another player joins the game. Just remove the PlayerAdded function and it should work properly. Local scripts start whenever you join meaning you would need another person to join for this current script to work.

2 Likes