Help with RankTag system

  1. What do you want to achieve? I’m attempting to make a ranktag system that uses NumberValues, so to explain more, in the script is a folder called “Teams” and in that, a user can add in a numbervalue, then set the name of the numbervalue to the team name, and the value of the numbervalue to the group id. In that number value is a color value called Color, which determines the persons ranktag color.

Basically, I’m trying to make a ranktag to check if you are on the team and in the group then it sets the ranklabel to the persons rank in the group, sorry if that was confusing.

  1. What is the issue? The system always detects a person as a guest even if they aren’t.

  2. What solutions have you tried so far? Dev hub, scriptinghelpers, even reddit.

-- Code below:

--// Requirments
local Players = game:GetService("Players")


--// Code
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)

		local nametag = script.Nametag:Clone()
		for i, v in pairs(script.Teams:GetChildren()) do
			if v:IsA("NumberValue") then
				local team = game.Teams:FindFirstChild(v.Name)
				if player:IsInGroup(v.Value) and player.Team.Name == v.Name then
					print("Cloning!")
					wait(3)
					nametag.RankLabel.TextColor3 = v.Color.Value
					nametag.PlayerName.Text = player.Name
					nametag.RankLabel.Text = player:GetRoleInGroup(v.Value)
					wait(3) 
					nametag.Parent = game.Workspace[player.Name].Head
					print("Sucess")
				else
					wait(3)
					warn("User is guest!")
					nametag.RankLabel.Text = "Guest"
					nametag.PlayerName.Text = player.Name
					nametag.Parent = game.Workspace[player.Name].Head

				end
			end



		end
	end)
end)
1 Like

Can you show me your object hierarchy under Teams in the Explorer tab?