Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

(SOLVED) Help with explaining why non-group members don't get a custom nametag?

So I'm making a custom overhead name system, this is the code that I think is causing it.

if RankTable.main == true then
RankGui.Parent = game.Players[Player.Name].Character.Head
RankGui.PlayerRank.Text = Player:GetRoleInGroup(Groups.main)
RankGui.PlayerRank.Visible = true
	
if RankTable.main == false then
	RankGui.Parent = game.Players[Player.Name].Character.Head--This is where the code stops because I tried doing a print and didn't get anything in server and local logs
	RankGui.PlayerRank.Visible = false--This is not the issue by the way.
end
end

It works with people in the group, so I don't know why it doesn't here.

1 answer

✓ Accepted answer

You have the second if statement inside of the first if statement. The entire block of code will only run if RankTable.main == true, otherwise none of it will run, including the second if statement. Try putting the second if statement separate from the first:

if RankTable.main == true then
	--Code if it's true
elseif RankTable.main == false then
	--Code if it's false
end

2 comments

0

I just tried, and got nothing on a non-member's head.

0

Nevermind, I just figured out. It was a mixture of positions and where I put end's

This discussion is preserved as it was. New answers, comments, and votes are closed.