Hello, I'm a beginner scripter.
I just scripted a overhead gui, its work but I want it to change the color and text when you changed team, the text is fine but the color won't change when I change team.
Here's my code, feel free to correct my script.
groupid = 3359981
aos = ""
game.Players.PlayerAdded:connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
wait(0.5)
local gui = script.Rank:clone()
gui.Parent=newPlayer.Character.Head
gui.Adornee=newPlayer.Character.Head
local rank=gui.Frame.TextLabel
rank.Text = newPlayer:GetRoleInGroup(groupid)
local name=gui.Frame.Name1
name.Text = newPlayer.Name
if newPlayer.name == "Arifafeef" then
name.Text = "[President] Arifafeef" -- Custom Nickname
if newPlayer.TeamColor == BrickColor.new("New Yeller") then -- Detects the player's team
name.TextColor3 = Color3.new(106, 57, 9) -- Changes the rank color but not works
rank.Text = newPlayer:GetRoleInGroup(3352821) -- Changes the text (works)
-- AOS (Arrest on Sight) Manager-
if newPlayer.name == aos then
rank.TextColor3 = Color3.new(255, 0, 0)
rank.TextStrokeTransparency = 0.1
name.TextColor3 = Color3.new(91, 0, 0)
name.TextStrokeColor3 = Color3.new(91, 0, 0)
name.TextStrokeTransparency = 0.2
rank.Text = "[AOS] Arrest On Sight"
end
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered)
Pictures :
For more infomation, click here https://i.imgur.com/OJmDZI2.png
When I'm in citizen team https://imgur.com/a/iOKSp
When I'm in CNN team https://imgur.com/a/L4jj6 (Its should change the name color but idk why, you can check the code)
What it supposed to be https://imgur.com/a/d549I (I do not use script for this, this just for show)
Please help me, if you don't know what I'm saying, feel free to DM me then I will explain. ArifAfeef#8789
