Hey!
So I made some Over-Head Gui’s for players, and I change the players text color, based on the team color. Blue team players get a blue text and red team players get a red text color. But my question is How can I make it show that you’re on the same team as the player you are looking at?
Here is my Over-Head Script:
local serverStorage = game:GetService("ServerStorage")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local Overhead = serverStorage:WaitForChild("OverHeadGUI"):Clone()
Overhead.Parent = char:WaitForChild("Head")
local LevelHead = serverStorage:WaitForChild("Level"):Clone()
LevelHead.Parent = char:WaitForChild("Head")
if player.DisplayName ~= player.Name then
Overhead.DisplayName.Text = player.DisplayName
else
Overhead.DisplayName.Text = player.Name
end
local leaderstats = player:WaitForChild("leaderstats")
local Level = leaderstats:WaitForChild("Level")
LevelHead.Text.Text = "Level: "..Level.Value
Level:GetPropertyChangedSignal("Value"):Connect(function(changed)
LevelHead.Text.Text = "Level: "..Level.Value
end)
if player.Team.Name == "Red" then
Overhead.DisplayName.TextColor3 = Color3.fromRGB(252, 0, 7)
end
if player.Team.Name == "Blue" then
Overhead.DisplayName.TextColor3 = Color3.fromRGB(9, 91, 255)
end
end)
end)
This Script is placed in ServerScriptService. The first part of the script is cloning the UI in ServerStorage, and puts it in parent, and making the text the players name. The Second part is getting the players level in my game, which you don’t need to worry about. The third part is changing the players text color, based on their team color.
Is there a way if you are on the same team as the player, it shows the players text?
If you can help, thanks!
Sincerely,