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

Billboard gui not showing up and color changer isn't working?

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 -- Yellow is the team name not team color
				frame.BackgroundColor3 = BrickColor.new("Buttermilk").Color
			elseif player.Team == "Green" then -- Green is team name not team color
				frame.BackgroundColor3 = BrickColor.new("Mint").Color
			end 

The billboard gui is in the player's head, but not showing up. Also, the "BackgroundColor3" property doesn't change. There's no error in the output, and this is only a portion of the script. Could somebody help?

2 comments

0

is there another part to the script? there doesn't seem to be a variable referencing "player" on line 1.

0

Yes, as I said in the op, this is only a portion of the script

1 answer

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 == game.Teams:FindFirstChild("Yellow") then -- Yellow is the team name not team color
                frame.BackgroundColor3 = BrickColor.new("Buttermilk").Color
            elseif player.Team == game.Teams:FindFirstChild("Green") then -- Green is team name not team color
                frame.BackgroundColor3 = BrickColor.new("Mint").Color
            end

player.Team is always linked to an actual team, not a name.

2 comments

0

Thank you Asceylos, the backround color changed to the right color, but how do I make the billboard gui show on top of the head? It isn't showing, yet it's in the player's head.

0

did you make a variable named player?

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