local TextChatService = game:GetService("TextChatService")
local rbxGeneralChannel = TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")
TextChatService.SendingMessage:Connect(function(textChatMessage)
local textChatMsgProperties = Instance.new("TextChatMessageProperties")
print(textChatMessage.Text)
if textChatMessage.Text == "hi" then
textChatMsgProperties.Text = "bye"
end
if textChatMessage.TextChannel == rbxGeneralChannel and #textChatMessage.Text > 0 then
textChatMsgProperties.Text = textChatMessage.Text .." [added]"
end
return textChatMsgProperties
end)
i want TO CHANGE some text from ‘hi’ to ‘bye’ and show it on both CHAT and BUBBLEchat and for everyone
I’m currently in the middle of improving this documentation to make this more clear. Let me know if this works better
TextChatService.OnIncomingMessage = function(textChatMessage)
local textChatMsgProperties = Instance.new("TextChatMessageProperties")
print(textChatMessage.Text)
if textChatMessage.Text == "hi" then
textChatMsgProperties.Text = "bye"
end
if textChatMessage.TextChannel == rbxGeneralChannel and #textChatMessage.Text > 0 then
textChatMsgProperties.Text = textChatMessage.Text .." [added]"
end
return textChatMsgProperties
end
“[added]” is being added because of these lines which were present in your OP:
if textChatMessage.TextChannel == rbxGeneralChannel and #textChatMessage.Text > 0 then
textChatMsgProperties.Text = textChatMessage.Text .." [added]"
end