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

How do you make the overhead GUI display the team's name?

Asked by
0rx2 3
4 years ago
Edited 4 years ago

For example, if I'm in a Cops team, the overhead GUI displays "Cops".

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You would want to create a BillboardGui with a TextLabel inside displaying the users team, and parent the GUI to (preferably) the head of the Character.

-- local script
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local team = player.Team

local gui = Instance.new("BillboardGui")
local teamlabel = Instance.new("TextLabel")

teamlabel.Text = player.Team.Name
teamlabel.Parent  = gui

gui.Parent = Character:WaitForChild("Head")

Additionally, if you want to call this when a user switches team:

player:GetPropertyChangedSignal("Team"):Connect(function()
    (code)
end)

Once you've done this, you can adjust the properties of the TextLabel and GUI in Test mode to your liking, and then edit these properties in the script.

1
Thank you very much, it worked. 0rx2 3 — 4y
0
If this helped you please mark it as solution, thanks. Shrilleh 68 — 4y
Ad

Answer this question