am just trying to do a script where it will display system messages in chat but it keeps giving error.
local msg = "My Message"
local TextService = game:GetService("TextChatService")
game.Players.PlayerAdded:Wait()
wait(5)
TextService.Channels.RBXGeneral:DisplaySystemMessage(msg)
error:
Channels is not a valid member of TextChatService “TextChatService”
TextService.TextChannels instead of TextService.Channels. You should be fine without a WaitForChild here because of the wait statement, but yeah it’s TextChannels not Channels.
If this is LegacyChatService you need to use a different method:
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
Text = "Text",
Color = Color3.fromRGB(255, 255, 255),
Font = Enum.Font.Michroma,
FontSize = Enum.FontSize.Size24
})
This must be a LocalScript under one of the following:
The error is self explanatory. The folder under TextChatService where the channels are located is called TextChannels, not Channels.
So you’d need to do this instead:
local generalChannel: TextChannel = TextService:WaitForChild("TextChannels").RBXGeneral
generalChannel:DisplaySystemMessage(msg)
WaitForChild would need to be used here since the TextChannels folder will appear at runtime. They aren’t already there prior to runtime. Note that the DisplaySystemMessage method can only be called in a Local Script.