Issue with Overhead GUI

Goal: If the player’s group rank is above 0, they should have a star emoji above their head.

Setup:
image

Script:


game.Players.PlayerAdded:Connect(function(player)
	local overheadClone = overhead:Clone()
	
	player.CharacterAdded:Connect(function() 
		local character = player.Character or player.CharacterAdded:Wait()
		overheadClone:FindFirstChild("Name").Text = player.Name
		overheadClone.Rank.Text = player:GetRoleInGroup(5127121)
		overheadClone.Parent = character.Head		
		
		if player:GetRoleInGroup(5127121) >= 0 then
			overheadClone.Emoji.Visible = true
		end
	end)
end)

And if you prefer reading it in the roblox layout:

You should be using :GetRankInGroup cause it brings back the rank number while :GetRoleInGroup brings back the name of the role (string value).

EDIT: Let me specify, you should be using :GetRankInGroup when you are comparing the rank to 0 with '>=".

So starting off what blushclips said:

thus you should do

if player:GetRankInGroup(5127121) >= 0 then
	overheadClone.Emoji.Visible = true
end

Edit: NVM, i wrote absolute nonsense, jeez i should get some sleep

1 Like