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

Trying to match brickcolor with color3?

local char = player.Character
			local head = char:FindFirstChild("Head")
			local bgui = Instance.new("BillboardGui")
			bgui.Parent = head
			bgui.Size = UDim2.new(1,0,1,0)
			bgui.Adornee = head
			bgui.StudsOffset = Vector3.new(0,2,0)
			bgui.AlwaysOnTop = true
			local frame = Instance.new("Frame")
			frame.Parent = bgui
			frame.BackgroundTransparency = 0.4
			if player.Team == "Yellow" then
				frame.BackgroundColor3 = BrickColor.new("Buttermilk").Color
			elseif player.Team == "Green" then
				frame.BackgroundColor3 = BrickColor.new("Mint").Color
			end 

This is only a portion of the script. It's supposed to be a billboard gui in the player's head to represent the team. There's no error in the output and the billboard gui is in the head but it doesn't show up while I test the game. Can someone help?

1 comment

0

Try adding some print statements throughout the code. I think the error might be on lines 12 and 14, comparing a BrickColor to a String.

1 answer

if player.Team == BrickColor.new("Insert Color Here")

should work

4 comments

0

You forgot the then and end lol

0

Yellow and green are the team names, not the colors... And that wouldn't work because it's locating the team not the teamcolor

0

I think you need to use .TeamColor to check if the player is in a team

0

No because I made a script for randomizing player's teams by locating the team name not the teamcolor and it worked

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