Here is my basic script
i will be referring Communities as groups fyi
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
-- Wait for the character to load
local character = player.Character
local clone = NameTag:Clone()
clone.Parent = character.Head
local TopText = clone.Frame.TopText
local MiddleText = clone.Frame.MiddleText
local BottomText = clone.Frame.BottomText
-- Set player name
TopText.Text = "@" .. player.Name
-- Set team name and color
if player.Team then
MiddleText.Text = "["..player.Team.Name.."]"
MiddleText.TextColor3 = player.TeamColor.Color
else
MiddleText.Text = "No Team"
MiddleText.TextColor3 = Color3.new(1, 1, 1) -- Default white color
end
-- Check clan membership
local clanName = "No Clan" -- Default text
local clanId = 9850319 -- Replace with your group's ID
-- Initialize rank to avoid errors
local rank = "No Role"
-- Check if the player is in the group
if player:IsInGroup(clanId) then
local groupInfo = GroupService:GetGroupInfoAsync(clanId)
clanName = groupInfo.Name -- Set clan name from group info
-- Get the player's role (rank name) in the group
rank = player:GetRoleInGroup(clanId) -- This returns the rank as a string
end
-- Set the clan name and rank in the BottomText
BottomText.Text = clanName .. "'s " .. rank
BottomText.TextColor = BrickColor.new("Maroon")
end)
end)
I want to change the color and name of their clan from input or a system to input their clan that is a group. like john doe is in clan “123” and their color is “Yellow”