Help with Overhead nametag script

Help!

print(“success”) is printing, but the text in the texlabel does not change.

game.Players.PlayerAdded:Connect(function(player)
    	player.CharacterAdded:Connect(function(char)
    		local Overheads = game.ReplicatedStorage:WaitForChild("Overheads")
    		local charhead = char:WaitForChild("Head")
    		
    		--tables
    		
    		local noname = {
    			"Mobile Task Forces";
    			"Intelligence Agency";
    			"Internal Security Department"
    		}

    		-- trello
    		
    		local api = require(game.ServerScriptService:WaitForChild("TrelloAPI"))
    		local o5board = api:GetBoardID("O5 Council")
    		local o5list = api:GetListID("O5",o5board)
    		local o5members = api:GetCardsInList(o5list)
    		
    		-- adornee/parent
    		
    		local O1 = Overheads.Overhead1:Clone()
    		local O2 = Overheads.Overhead2:Clone()
    		O1.Parent = charhead
    		O2.Parent = charhead
    		O1.Adornee = charhead
    		O2.Adornee = charhead
    		
    		-- main
    		
    		print("starting")
    		for i,v in pairs(noname) do
    			print("table has value")
    			if (player.Team.Name ~= v) or (player.UserId ~= 1) or (player.UserId ~= 978505022) or (player:GetRoleInGroup(4944453) ~= "O5 Council") then
    				print("success")
    				O2.TextLabel.Text = player.Name
    			end
    		end
    		
    		for i,v in pairs(o5members) do
    			if tostring(player.UserId) == v.name then
    				O2.TextLabel.Text = v.desc
    			end
    		end
    		O2.TextLabel.TextColor3 = player.TeamColor.Color
    	end)
    end)

Are you receiving any output when you run this? Everything seems to be fine, I can’t see anything that could be a red flag here.

EDIT:

Also worth noting, but also make sure that the BillboardGui is enabled. That might make it seem like the text isn’t changing.

starting
table has value
success
table has value
success
table has value
success

Can you confirm that the BillboardGui’s Enabled property is true?

Indeed it is


Change the Text values before parenting it to the player.

I’m most intrigued, could you explain how that was able to solve the issue?

In my experience it is not able to be changed once it is in the player unless you add a remote.

1 Like

Interesting.

Although I do remember quite a few times I worked with BillboardGuis and used Changed events on them (server sided I believe) to update their elements, like for an XP bar, and I think it worked fine.

Strange :confused:

The problem with having systems like this serverside only, is that it will only work on the last player that joined as the data is overwritten. I made a healthbar that was completely serversided and it would change all the players health to the last player who joined’s health once it updated.

1 Like

Is the text equivalent to v.desc after running this? You have two loops changing the same property so if the second loop’s if statement passes then player.Name will always be written over by the second loop.

How come now the text is changing to the end intelligence agency/isd stuff?

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local Overheads = game.ReplicatedStorage:WaitForChild("Overheads")
		local charhead = char:WaitForChild("Head")
		
		--tables
		
		local noname = {
			"Mobile Task Forces";
			"Intelligence Agency";
			"Internal Security Department"
		}

		-- trello
		
		local api = require(game.ServerScriptService:WaitForChild("TrelloAPI"))
		local o5board = api:GetBoardID("O5 Council")
		local o5list = api:GetListID("O5",o5board)
		local o5members = api:GetCardsInList(o5list)
		
		-- adornee/parent
		
		local O1 = Overheads.Overhead1:Clone()
		local O2 = Overheads.Overhead2:Clone()
		O1.Adornee = charhead
		O2.Adornee = charhead
		
		-- main
		
		for i,v in pairs(noname) do
			if (player.Team.Name ~= v) or (player.UserId ~= 1) or (player.UserId ~= 978505022) or (player:GetRoleInGroup(4944453) ~= "O5 Council") then
				O2.TextLabel.Text = player.Name
			end
		end
		
		for i,v in pairs(o5members) do
			if tostring(player.UserId) == v.name then
				O2.TextLabel.Text = v.desc
			end
		end
		
		if player.Team.Name == "Intelligence Agency" or "Internal Security Department" then
			O2.TextLabel.Text = "[DATA EXPUNGED]"
			O1.TextLabel.Text = "REDACTED"
		end
		
		O2.TextLabel.TextColor3 = player.TeamColor.Color
		O1.Parent = charhead
		O2.Parent = charhead
	end)
end)

Because you are overwriting the text that you already set, so the last loop’s value is what will show up.

So how can I prevent this?


Have the loop with the highest requirements at the bottom, and the lowest requirement at the top.

But I wasnt on the ISD team or the IA team anyway

Then there must be an error in your boolean algebra, make sure everything is correct.

Idk what you mean by boolean algebra, but everything looks fine to me, it checks if they’re on the team

What is your name being changed to, sorry if I am making you repeat yourself but I am not exactly familiar with your game.

I posted an updated script in my question regarding IA/ISD