Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I go about making a GUI that shows the team and makes the makes the GUI the teams color?

(Title) If that makes sense. I want to have a GUI that shows the team that a player is on as well as making the GUI the color of the team they are on. Would anyone have a script I could use?

1 answer

You're likely to steal this, especially as it's a request. Though I thought I'd post it anyway to help educate anyone else who was curious.

local players = game:GetService("Players")
local player = players.LocalPlayer

local teamGUI = script.Parent --// Likely a TextLabel

local function adjustTeamInfo()
	local team = player.Team
	if (team) then
		local teamName, teamColor = team.Name, player.TeamColor
		teamGUI.Text = teamName
		teamGUI.BackgroundColor3 = teamColor.Color
	end
end

adjustTeamInfo()
player:GetPropertyChangedSignal("Team"):Connect(adjustTeamInfo)

3 comments

0

Thanks!

0

Accept the answer m8

0

Bro, at-least accept the answer if you stole it.

This discussion is preserved as it was. New answers, comments, and votes are closed.