Help With Changing Color of Chat Badge Alert

I have this script where basically when you walk over a certain part it’ll give you a badge if you haven’t gotten already and a message will appear in chat specifying what you got. The only problem with the script is that it makes it a default yellow color which I would like to change. I’ve looked up a lot of forum posts/tutorials/ looking on the roblox page but I’m unable to find anything that helps my situation in particular. I posted this almost two weeks ago as well and got no response so hopefully I can find someone to help :smiling_face_with_tear:

local badgeservice = game:GetService("BadgeService")
local id = 2142102522 --Put your id here

local serverScriptService = game:GetService("ServerScriptService")

local debounce = false
local Cooldown = 1000000000
local ExtraData = {
	ChatColor = Color3.new(0.603922, 0.286275, 0.501961)
}--Cooldown for avoid spam from Touched Event

local Part = script.Parent
Part.Touched:Connect(function(HitPlr)
	if debounce then return end
	debounce = true
	--BadgeGiver--
	if HitPlr.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(HitPlr.Parent.Name) then
		local Player = game.Players[HitPlr.Parent.Name]
		if not game:GetService("BadgeService"):UserHasBadgeAsync(Player.UserId, id) then
			badgeservice:AwardBadge(Player.UserId, id)
			game.ReplicatedStorage.SendChatEvent:FireAllClients(" Welcome To Our Difficulty Chart Obby "..Player.Name,ExtraData);
			
		end
	end
	--Cooldown
	task.wait(Cooldown)
	debounce = false
end)

This is the script above. I had attempted to add the color portion of it but I am a beginner scripter so I am unsure of how to do it. Any help is appreciated!

If you click anywhere inside the parenthesis (within the Color3), two buttons will appear (https://gyazo.com/02ccb40948a61638db286ea86a735bb5). Click the first one to bring up a menu that allows you to pick the color rather than setting values.

2 Likes

I know that, haha. As mentioned above, I had attempted to script it so the chat message would change color but the scripting I had inserted did not work at all. (Just disregard the color script inserted)

I don’t think it is possible to modify the color of the message once it has been sent (as needed with a color changing script), I may be incorrect though.

Aw, man. So there’s no way to alter the color of the message in the script?

You can make it a singular color, but you can’t make it rainbow or change colors or anything like that (without a custom chat GUI).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.