Make a textlabel show the player's team?

no team change script, it’s just a randomized team. all the teams have AutoAssignable on and it’s just a free for all on who gets what

(for now)
it will be a server script when i can be bothered to script it

Okay, i think the issue is the gui itself, the server doesn’t see it, because the client “cloned” it therefore only “replicating” to the client that cloned it.
Have you made sure the server clones the gui to character head?

WHY ARE YOU CHECKING WHAT IS THE TEAM’S NAME? JUST DO team.Text = player.Team.Name

1 Like

yes… server clones it

it’s a regular script inside serverscriptservice, with the ui inside it.

i know it works because the name and rank are handled through the same script and they work perfectly, just teams are giving me an issue.

because each team has it’s own colour, and i’m showing a colour depending on the team.
my script is not ‘complicated’

You are very frustrating. Why even ask about this stuff if you never listen to ANYBODY. There is so many people with the right awnser but you keep changing the script the wrong way every time.

1 Like

make a normal script INSIDE the billboard gui.

local __PLAYER = game:GetService("Players"):GetPlayerFromCharacter(script.Parent.Parent.Parent) -- first parent is billboardgui, second parent is head and third is character model!
local __TEAMS = game:GetService("Teams")
script.Parent.TextLabelHere.Text == __PLAYER.Team.Name -- make sure it runs in case the player is automatically assigned a team on cloned!
__PLAYER:GetPropertyChangedSignal("TeamColor"):Connect(function()
   if __PLAYER.Team == __TEAMS["whatever"] then
    script.Parent.TextLabelHere.Text = "whatever"
  end
--[[ if you dont want an if statement you can do this
   script.Parent.TextLabelHere.Text == __PLAYER.Team.Name
--]]
end)

people have given me answers and every time i try it the way they want me to, it does nothing.

i’ve tried the way volieb wanted me to,

and it didn’t work.

Can I see what you’re trying? You must not be replacing every line.

	game.Players.PlayerAdded:Connect(function(plr)
		plr.CharacterAdded:Connect(function(chr)
			team.Text = plr.Team.Name
			if plr.Team == "Visitor" then
				team.TextColor3 = VisitorColour
			elseif plr.Team == "Student" then
				team.TextColor3 = StudentColour
			elseif plr.Team == "Staff" then
				team.TextColor3 = StaffColour
			elseif plr.Team == "Council" then
				team.TextColor3 = CouncilColour
			end
		end)
	end)

my original script, just changing plr.Team to plr.Team.Name

You still didn’t replace all of them with plr.Team.Name

Try what i posted and tell me what happens.

1 Like

this?

	game.Players.PlayerAdded:Connect(function(plr)
		plr.CharacterAdded:Connect(function(chr)
			team.Text = plr.Team.Name
			if plr.Team.Name == "Visitor" then
				team.TextColor3 = VisitorColour
			elseif plr.Team.Name == "Student" then
				team.TextColor3 = StudentColour
			elseif plr.Team.Name == "Staff" then
				team.TextColor3 = StaffColour
			elseif plr.Team.Name == "Council" then
				team.TextColor3 = CouncilColour
			end
		end)
	end)

i replaced them all and it still didn’t work.

my script is this

	game.Players.PlayerAdded:Connect(function(plr)
		plr.CharacterAdded:Connect(function(chr)
			team.Text = plr.Team.Name
			if plr.Team.Name == "Visitor" then
				team.TextColor3 = VisitorColour
			elseif plr.Team.Name == "Student" then
				team.TextColor3 = StudentColour
			elseif plr.Team.Name == "Staff" then
				team.TextColor3 = StaffColour
			elseif plr.Team.Name == "Council" then
				team.TextColor3 = CouncilColour
			end
		end)
	end)

Use what weakroblox35 used.

I just tried this, it didn’t work either.
nothing in output.

I have nothing that prints in output?

I tried your script and it didn’t work :sob:

OH

IT DID

my billboardgui doesn’t clone into the head, but you put Parent.Parent.Parent, which went to workspace, so i changed it to Parent.Parent and it worked

thank you!

1 Like

I meant there was no errors, not any print statements lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.