Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to have multiple chat colors for multiple gamepasses?

I was wondering how to add multiple chat colors for multiple game passes, example: if somebody owns the Orange game pass, then they get a Orange tag. and if the same person buys Blue tag, then the Orange tag is deleted and replaced with Blue tag. here is my script:

 local gamepassId = 8560723

admins = (player.UserId, gamepassId))

admins2 = (player.UserId, gamepassId2)

ChatTextColor = 'New Yeller'

NameColor = 'New Yeller'

for i,who in pairs (admins) do

	game.DescendantAdded:Connect()(function(a)

		pcall(function()

			if a.ClassName=='TextButton' then

				local b = a

				if string.find(b.Text,who..']') then

					if ChatTextColor ~= '' then

						b.Parent.TextColor=BrickColor.new'New Yeller'

					end

				end)

			end)

		end)

	end)

end

Other gamepass id: 9001929

1 comment

0

Nevermind, i fixed it. here is the fixed script

1 answer

Nevermind, i fixed it. here is the fixed script



local gamepassId = 8560723
local gamepassId2 = 9001929
admins = (player.UserId, gamepassId))
admins2 = (player.UserId, gamepassId2)
ChatTextColor = 'New Yeller'
NameColor = 'New Yeller'
ChatTextColor2 = 'Really red'
NameColor2 = 'Really red'
for i,who in pairs (admins) do
    game.DescendantAdded:Connect()(function(a)
        pcall(function()
            if a.ClassName=='TextButton' then
                local b = a
                if string.find(b.Text,who..']') then
                    if ChatTextColor ~= '' then
                        b.Parent.TextColor=BrickColor.new'New Yeller'
                    end
		for i,who in pairs (admins2) do
    game.DescendantAdded:Connect()(function(a)
        pcall(function()
            if a.ClassName=='TextButton' then
                local b = a
                if string.find(b.Text,who..']') then
                    if ChatTextColor2 ~= '' then
                        b.Parent.TextColor=BrickColor.new'Really red'
                end)
            end)
        end)
    end)
end


This discussion is preserved as it was. New answers, comments, and votes are closed.