Hello, I am trying to reference the chat module script to change a player's text color and it's not changing their text color, but upon the variable being printed, it is definitely making a change to the variable in the modulescript. Here's the code:

local ChatSettingsModule = require(game.Chat.ClientChatModules.ChatSettings)

game.Players.PlayerAdded:connect(function(player)
	player.Chatted:connect(function(message)
		if message:lower() == "/changecolor purple" then
			ChatSettingsModule.DefaultMessageColor = Color3.fromRGB(192, 0, 209)
		end
	end)
end)

4 comments

0

embed a while loop into the function so it constantly checks for Chatted

0

The hell, Chatted is an event, it runs every time the player chats, Also use ":Connect", ":connect" is deprecated

0

Using a loop defeats the purpose, I am trying to get the player's text to change color upon the message being typed. This function already detects when the player types the command, and it works in changing the variable, but for some reason the player's text color is not changing. I am assuming it has to do with this being the default, and it just changes the default for new players that join

0

^^ if anyone is familiar with the chat service it'd be a great help