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

How do you make BillboardGui only visible locally?

I'm trying to make it to where you can see a BillboardGui on top of your team-members only, but I can't get it to work. This is in a LocalScript in Workspace.

wait(1)

local player = game.Players.LocalPlayer

if player.TeamColor == BrickColor.new("Bright red") then
	for _,v in pairs(game.Players:GetPlayers()) do
		if v.TeamColor == BrickColor.new("Bright red") then
			local tag = Instance.new("BillboardGui", v.Character.Head)
			tag .Size = UDim2.new(0, 50, 0, 60)
			tag .StudsOffset = Vector3.new(0, 4, 0)

			local frame = Instance.new("Frame", tag )
			frame .Size = UDim2.new(0, 50, 0, 60)
			frame .BackgroundColor3 = Color3.new(181/255, 0, 0)
			frame .BorderColor3 = Color3.new(181/255, 0, 0)

			local textLabel = Instance.new("TextLabel", frame)
			textLabel.Size = UDim2.new(0, 50, 0, 60)
			textLabel.BackgroundTransparency = 1
			textLabel.Font = "ArialBold"
			textLabel.FontSize = "Size48"
			textLabel.Text = "Friendly"
			textLabel.TextColor3 = Color3.new(1, 1, 1)
		end
	end	
end

2 answers

✓ Accepted answer

LocalScripts don't work in the Workspace. Put this in StarterGui instead.

If the GUI works, but is not local to that specific player, trying parenting it to Workspace.CurrentCamera.

1 comment

0

Thanks! It works! I +1'd your Reputation! By the way, if have another problem if you can possibly help me with it. Now, it works, but it shows the BillboardGui even when I'm not on the same team as the player even though I instructed it to not do that. Can you help me? Thanks in advance.

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