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
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!