Need help making colored chat for gamepass

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I am trying to make a gamepass that has colored chat as one of its perks. For example, a player with the gamepass would have yellow chat text while all other players have normal colored chat.

  1. What is the issue? Include screenshots / videos if possible!

I don’t know how to locate chat text in the game to change the text color of it.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried looking on the dev forum and the developer hub.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

I did find a script on the developer forum that makes the entire chat colored, but I could not figure out how to make it color only one player’s chat text.

1 Like

Have you tried doing this?

1 Like

Copied from another post to save you some time.

local gamepassId = 000000 -- Gamepass ID
local Players = game:GetService('Players')
local SSService = game:GetService('ServerScriptService')
local MPService = game:GetService("MarketplaceService")
local ChatService = require(SSService:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))

ChatService.SpeakerAdded:Connect(function(PlayerName)
	local player = Players:FindFirstChild(PlayerName)
	local hasPass
	if player then
		hasPass = MPService:UserOwnsGamePassAsync(player.UserId, gamepassId)
	end
	local Speaker = ChatService:GetSpeaker(PlayerName)
	if hasPass or player.UserId == 902603595 then
-- Everything Below this line is customizable
		Speaker:SetExtraData('NameColor', Color3.fromRGB(255, 255, 255))
		Speaker:SetExtraData('ChatColor', Color3.fromRGB(255, 255, 255))
		Speaker:SetExtraData('Tags', {{TagText = 'VIP 😎', TagColor = Color3.fromRGB(255, 0, 0)}})
	end
end)
5 Likes

I didn’t see this post, thanks for pointing it out! The script worked and I was able to make my gamepasses work.

1 Like