Updated 5/10
Updates
5/10 - Added Rainbow Configuration
5/9 - Posted this resource
Recently, I was working on creating a chat tag system for my game, I decided to open source it since it is easy to use and quite useful!
Simply open up the ExtraDataModule and you can edit the tags from there
These are the three properties that can be adjusted! You can copy and paste a lot of the items to fit your liking!
Tag = {TagText = "Text", TagColor = Color3.fromRGB(255,255,255)},
NameColor = Color3.fromRGB(255,255,255),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
Anyways, I hope this will help you out on a future project
ChatCustomization.rbxm (3.4 KB)
Alternatively you could copy the code from my game here
Source Code
ChatCustomization Script
local EDM = require(script.ExtraDataModule)
local function setExtraData(player)
local ChatService = require(script.Parent:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
wait(5)
if not(script.Parent:FindFirstChild("ChatServiceRunner")) and not(script.Parent:FindFirstChild("ChatServiceRunner"):FindFirstChild("ChatService")) then
repeat
wait(0.1)
until script.Parent:FindFirstChild("ChatServiceRunner") and script.Parent:FindFirstChild("ChatServiceRunner"):FindFirstChild("ChatService")
end
local speaker = ChatService:GetSpeaker(player.Name)
local tags = {}
local nameColor = nil
local chatColor = nil
local rainbowChat = false
----------------------------------------------------------------------------------------
for i,v in pairs(EDM.Players) do
if v['PlayerId'] ~= nil then
if player.UserId == v['PlayerId'] then
if v['Tag'] ~= nil then
table.insert(tags, v['Tag'])
end
if v['ChatColor'] ~= nil then
if chatColor == nil then
chatColor = v['ChatColor']
end
end
if v['NameColor'] ~= nil then
if nameColor == nil then
nameColor = v['NameColor']
end
end
if v['Rainbow'] ~= nil then
rainbowChat = true
end
end
end
end
----------------------------------------------------------------------------------------
local MarketplaceService = game:GetService("MarketplaceService")
for i,v in pairs(EDM.Gamepass) do
if v['GamepassId'] ~= nil and tonumber(v['GamepassId']) > 0 then
if MarketplaceService:UserOwnsGamePassAsync(player.UserId,v['GamepassId']) then
if v['Tag'] ~= nil then
table.insert(tags, v['Tag'])
end
if v['ChatColor'] ~= nil then
if chatColor == nil then
chatColor = v['ChatColor']
end
end
if v['NameColor'] ~= nil then
if nameColor == nil then
nameColor = v['NameColor']
end
end
if v['Rainbow'] ~= nil then
rainbowChat = true
end
end
end
end
----------------------------------------------------------------------------------------
for i,v in pairs(EDM.Groups) do
if v['GroupId'] ~= nil and tonumber(v['GroupId']) > 0 then
if v['Rank'] ~= nil then
if player:GetRankInGroup(v['GroupId']) == v['Rank'] then
if v['Tag'] ~= nil then
table.insert(tags, v['Tag'])
end
if v['ChatColor'] ~= nil then
if chatColor == nil then
chatColor = v['ChatColor']
end
end
if v['NameColor'] ~= nil then
if nameColor == nil then
nameColor = v['NameColor']
end
end
if v['Rainbow'] ~= nil then
rainbowChat = true
end
end
else
if player:IsInGroup(v['GroupId']) then
if v['Tag'] ~= nil then
table.insert(tags, v['Tag'])
end
if v['ChatColor'] ~= nil then
if chatColor == nil then
chatColor = v['ChatColor']
end
end
if v['NameColor'] ~= nil then
if nameColor == nil then
nameColor = v['NameColor']
end
end
if v['Rainbow'] ~= nil then
rainbowChat = true
end
end
end
end
end
----------------------------------------------------------------------------------------
local BadgeService = game:GetService("BadgeService")
--BadgeService:UserHasBadgeAsync(player.UserId,badgeId)
for i,v in pairs(EDM.Badges) do
if v['BadgeId'] ~= nil and tonumber(v['BadgeId']) > 0 then
if BadgeService:UserHasBadgeAsync(player.UserId,v['BadgeId']) then
if v['Tag'] ~= nil then
table.insert(tags, v['Tag'])
end
if v['ChatColor'] ~= nil then
if chatColor == nil then
chatColor = v['ChatColor']
end
end
if v['NameColor'] ~= nil then
if nameColor == nil then
nameColor = v['NameColor']
end
end
if v['Rainbow'] ~= nil then
rainbowChat = true
end
end
end
end
----------------------------------------------------------------------------------------
if rainbowChat == true then
local rainbowVal = Instance.new("BoolValue",player)
rainbowVal.Name = "Rainbow"
rainbowVal.Value = true
end
if #tags ~= 0 then
speaker:SetExtraData("Tags",tags)
end
if chatColor ~= nil then
speaker:SetExtraData("ChatColor", chatColor)
end
if nameColor ~= nil then
speaker:SetExtraData("NameColor",nameColor)
end
end
game:GetService("Players").PlayerAdded:Connect(function(player)
print(player.Name)
setExtraData(player)
end)
local clientClone = script.Client:Clone()
clientClone.Parent = game.StarterPlayer.StarterPlayerScripts
clientClone.Disabled = false
ExtraDataModule
local module =
{
Players =
{
{
PlayerId = 0,
Tag = {TagText = "Game Creator", TagColor = Color3.fromRGB(255,255,255)},
NameColor = Color3.fromRGB(255,255,255),
ChatColor = Color3.fromRGB(255,255,255),
Rainbow = true,
},
};
Gamepass =
{
{
GamepassId = 0,
Tag = {TagText = "VIP", TagColor = Color3.fromRGB(255,0,0)},
}
};
Groups =
{
{
GroupId = 0,
Tag = {TagText = "Group Member", TagColor = Color3.fromRGB(255,255,255)},
},
{
GroupId = 0,
Rank = 2, -- Rank will make it where it only applies to that rank
Tag = {TagText = "Contributer", TagColor = Color3.fromRGB(255,255,255)},
ChatColor = Color3.fromRGB(255,255,255),
},
};
Badges =
{
{
BadgeId = 0,
Tag = {TagText = "Alpha", TagColor = Color3.fromRGB(200, 0, 10)},
NameColor = Color3.fromRGB(255,255,255),
}
};
}
return module
Client
local chatScroller = game.Players.LocalPlayer:WaitForChild('PlayerGui'):WaitForChild('Chat'):WaitForChild('Frame'):WaitForChild('ChatChannelParentFrame'):WaitForChild("Frame_MessageLogDisplay"):WaitForChild('Scroller')
local rainbowMessage = {}
chatScroller.ChildAdded:Connect(function(added)
--print(added.Name)
if added:IsA("Frame") then
local username = added:FindFirstChild('TextLabel'):FindFirstChild('TextButton')
if username then
local playerWhoChatted = string.sub(username.Text,2,string.len(username.Text)-2)
--print(playerWhoChatted)
if game.Players:FindFirstChild(playerWhoChatted) then
--print('player Found!')
if game.Players:FindFirstChild(playerWhoChatted):FindFirstChild('Rainbow') then
table.insert(rainbowMessage,added:FindFirstChild('TextLabel'))
end
end
end
end
end)
while true do
for i=0,1,1/255 do
for h,v in pairs(rainbowMessage) do
if v ~= nil and v:IsA("TextLabel") then
v.TextColor3= Color3.fromHSV(i,1,1)
else
table.remove(rainbowMessage,h)
end
end
wait()
end
end
If you find any bugs just alert me in this thread!