Overhead rank color changing

Hello, so I am looking for a script that allows something like thi


I know this is a script but you would have to put in each person rank and etc individual I want it to be when you buy the rank it will know the rank in group you have and your user and etc. not doing each thing individual.
local isAdmin = {[""] = true}

local rs = game:GetService(“ReplicatedStorage”)
local remotefolder = rs:WaitForChild(“RankFolder”)
local remote = remotefolder:WaitForChild(“RankPlayerOnRespawn”)

remote.OnServerEvent:connect(function(Player)
if not Player then
print(“ERROR Can’t fetch the player”)
end
local pRank = Player:GetRoleInGroup(0)
wait(1)
local ui = script.Rank:Clone()
ui.Parent = Player.Character
ui.Adornee = Player.Character.Head

while not Player.Character.Humanoid do wait() end
Player.Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
local frame = ui.Frame
local name = frame.Name1
local role = frame.TextLabel

name.Text = Player.Name
role.Text = pRank

if name.Text == "USERNAME" then -- Username here
	name.TextStrokeTransparency = 0
	name.TextStrokeColor3 = Color3.new(0, 0, 0) -- Name color
	role.TextStrokeTransparency = 0
	role.TextStrokeColor3 = Color3.new(0, 0, 0) -- Rank color
	role.Text = "PUTRANKNAMEHERE" -- Rank name
elseif name.Text == "USERNAME" then -- Username here
	name.TextStrokeTransparency = 0
	name.TextStrokeColor3 = Color3.new(0, 0, 0) -- Name color
	role.TextStrokeTransparency = 0
	role.TextStrokeColor3 = Color3.new(0, 255, 0) -- Rank color
    role.Text = "PUTRANKNAMEHERE" -- Rank name here

elseif name.Text == “USERNAME” then – Username here
name.TextStrokeTransparency = 0
name.TextStrokeColor3 = Color3.new(0, 0, 0) – Name color
role.TextStrokeTransparency = 0
role.TextStrokeColor3 = Color3.new(0, 255, 0) – Rank color
role.Text = “PUTRANKNAMEHERE” – Rank name here
elseif name.Text == “USERNAME” then – Username here
name.TextStrokeTransparency = 0
name.TextStrokeColor3 = Color3.new(0, 0, 0) – Name color
role.TextStrokeTransparency = 0
role.TextStrokeColor3 = Color3.new(0, 255, 0) – Rank color
role.Text = “PUTRANKNAMEHERE” – Rank name here
elseif name.Text == “USERNAME” then – Username here
name.TextStrokeTransparency = 0
name.TextStrokeColor3 = Color3.new(0, 0, 0) – Name color
role.TextStrokeTransparency = 0
role.TextStrokeColor3 = Color3.new(0, 255, 0) – Rank color
role.Text = “PUTRANKNAMEHERE” – Rank name here

end

– EXAMPLE:
–[[
elseif name.Text == “xboxcoder59_plays” then – Username here
name.TextStrokeTransparency = 0
name.TextStrokeColor3 = Color3.new(255, 0, 0) – Name color
role.TextStrokeTransparency = 0
role.TextStrokeColor3 = Color3.new(255, 0, 0) – Rank color
role.Text = “Owner // Developer” – Rank name here
end
–]]

if isAdmin[Player.Name] then

wait(2)
while wait() do
local rc = math.random(0,255)
local gc = math.random(0,255)
local bc = math.random(0,255)
local r = rc / 255
local g = gc / 255
local b = bc / 255
local c = Color3.new(r, g, b)
for i = 0,1,0.03 do
wait()
Player.Character.Rank.Frame.Name1.TextColor3 = Player.Character.Rank.Frame.Name1.TextColor3:lerp(c,i)
Player.Character.Rank.Frame.TextLabel.TextColor3 = Player.Character.Rank.Frame.Name1.TextColor3:lerp(c,i)
end
end
end
end)
^example of a script that you have to add ranks and name and color individually

Is there a place where I would fill in the group id or do I hav ego write name my name. Tysm.

local GroupId = 0
local OverheadNames = require(script.Parent)
OverheadNames.Initialize()
game.Players.PlayerAdded:Connect(function(player)
	--(player,Title,{BorderSize,BorderColor,BackgroundTransparency,BackgroundColor,TextColor,TextFont},{MaxDistance,AlwaysOnTop})
	local Rank = player:GetRankInGroup(GroupId)
	if Rank == 255 then
		OverheadNames.UpdateName(player,"Owner",{2,Color3.fromRGB(255,0,0),0,Color3.fromRGB(0,0,0),Color3.fromRGB(255,0,0),"Arial"},{60, false})
	end
end)

Would this script work even though it’s like smaller?

It still uses the other script (the module script)

Create a ModuleScript and put it in ServerScriptService then paste the “big script” and paste it into the ModuleScript

Create a Script and put it in ServerScriptService then paste the “small script” inside

If you dont understand how this works, read about it on the api-reference.

Can I just say, the player in that video’s username is the name of an exploit lol