Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make an overhead GUI that displays a team member's name in green?

Asked by 10 years ago

I have no idea how to start this one. I made fake heads in the players to make it so you can't see anyone's name. Now I need to make an overhead GUI only seen on your teammates.

1 answer

Log in to vote
1
Answered by
User#2 0
10 years ago

To do this, when a player spawns on a team, they need to do some stuff on the client.

First you want to loop through all the players. This is a nice and simple for loop that does that.

for i,v in pairs(game.Players:GetPlayers()) do
    -- Do checks
end

Then you want to check if that player is on your player's team.

if v.TeamColor == game.Players.LocalPlayer.TeamColor then
    -- Add the BillboardGui to the Camera
end

Once you've done that you should instance a BillboardGui to your player's camera, and set it's Adornee property to the player who your checking's head.

local bbGui = Instance.new("BillboardGui", game.Workspace.CurrentCamera)
bbGui.Adornee = v.Character.Head

Once you've done that, adding what you want inside of the billboard gui should be as simple as cloning something from ReplicatedStorage, putting it in the bbGui and then changing the text of a TextLabel.

0
Thanks. I'll try it out. broboch479 15 — 10y
Ad

Answer this question