Ranks wont show up

heeey, another question, the ranks won’t show up. does this have to be in a localscript? if in a localscript, then the serverstorage can’t be accessed. this is a script inside serverscriptservice.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Wait()
	if player:IsInGroup(5872229) == 1 then -- guest
		game.ServerStorage:WaitForChild("Customer"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 5 then -- customer
		game.ServerStorage:WaitForChild("HC"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 80 then -- reg shopper
		game.ServerStorage:WaitForChild("RegularShopper"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 90 then -- divine
		game.ServerStorage:WaitForChild("Divine"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 100 then -- legendary
		game.ServerStorage:WaitForChild("Legendary"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 154 then -- sales trainee
		game.ServerStorage:WaitForChild("SalesTrainee"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 210 then -- sales trainee
		game.ServerStorage:WaitForChild("SalesIntern"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 220 then -- designer
		game.ServerStorage:WaitForChild("Designer"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 225 then -- admin assistant
		game.ServerStorage:WaitForChild("AdminAssistant"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 230 then -- general manager
		game.ServerStorage:WaitForChild("General_Manager"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 235 then -- exclusive intern
		game.ServerStorage:WaitForChild("ExIntern"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 240 then -- public rel manager
		game.ServerStorage:WaitForChild("PublicRel"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 243 then -- human resources manager
		game.ServerStorage:WaitForChild("Human Resources Manager"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 245 then -- operations manager
		game.ServerStorage:WaitForChild("OpManager"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 250 then -- executive director
		game.ServerStorage:WaitForChild("exDirector"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 253 then -- presidential assistant
		game.ServerStorage:WaitForChild("Presidental Assistant"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 254 then -- vice president
		game.ServerStorage:WaitForChild("VC"):Clone().Parent = player.Character.Head
		elseif player:IsInGroup(5872229) == 255 then -- president
		game.ServerStorage:WaitForChild("President"):Clone().Parent = player.Character.Head
	end
end)

Could you give a bit more context on what this is, also I wouldn’t recommend using this method at all, use a table or something for a start. Also use indents so your code is organised.

You are using the wrong function. Check out this one which gets the player rank. Player | Documentation - Roblox Creator Hub

If you are trying to get the name of the rank the player is for the given group you should use player:GetRoleInGroup("GROUP ID").

1 Like

Did that, but how should I access the serverStorage that way? LocalScripts cannot access serverStorage, so where should I put all my billboardGui?

ReplicatedStorage if you want the client (LocalScripts) to be able to access it. I think you should move this to a server Script though (then put that Script in ServerScriptService)

Personally I’d put a script in ServerScriptService with the billboard gui inside, then clone the gui, making the parent the players character head and edit the text (or the gui fully) to the users role in the group using Player:GetRoleInGroup().

That’s what I did.

Can you show me a screenshot, and your updated code in which you should have?