I assume whenever a ‘message’ is sent to a TextChannel it carries a ‘status’, which in your case it was Enum.TextChatMessageStatus.Success which means the message was delivered. Quite odd and I’m not quite sure why it’d print ‘success’.
Just make sure you have your ChatVersion on TextChatService:
And I’m not sure why you’re using local RBXGeneral = TextChannels and TextChannels.RBXSystem.
Just use:
local textChannels = TextChatService:WaitForChild("TextChannels")
local generalChannel = textChannels:WaitForChild("RBXGeneral")
i am so confused rn still doesn’t work Status prints Success btw
local TextChatService = game:GetService("TextChatService")
local TextChannels = TextChatService:WaitForChild("TextChannels")
local RBXGeneral = TextChannels:WaitForChild("RBXGeneral")
game:GetService("ReplicatedStorage").RemoteEvent.OnClientEvent:Connect(function(msg, playername)
print("Hello?")
print(msg, playername)
local Result = RBXGeneral:DisplaySystemMessage(msg..playername)
print(Result.Status)
end)
-- client:
game.Players.PlayerAdded:Connect(function(player)
game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(`{player.Name} just joined the game.`)
end)
players.PlayerAdded does indeed work on the client. But you’re probably testing this in a solo place. Which means that the event loads in after the player joins, therefore the event doesn’t get fired for your own player. But for other players, it will display it.
You should still avoid using a RemoteEvent, you don’t need it. The client will not fire PlayerAdded for itself though. But, why would one need a welcome message for theirself?
i mean like is there any property or method for that? like player:GetChatColor() or something
cuz i have a trail and the color will be based on what color on there chattextcolor
I’m not sure if this is deprecated, however I found this topic:
And you can use the ComputeNameColor function down below:
local NAME_COLORS =
{
Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
BrickColor.new("Bright violet").Color,
BrickColor.new("Bright orange").Color,
BrickColor.new("Bright yellow").Color,
BrickColor.new("Light reddish violet").Color,
BrickColor.new("Brick yellow").Color,
}
local function GetNameValue(pName)
local value = 0
for index = 1, #pName do
local cValue = string.byte(string.sub(pName, index, index))
local reverseIndex = #pName - index + 1
if #pName%2 == 1 then
reverseIndex = reverseIndex - 1
end
if reverseIndex%4 >= 2 then
cValue = -cValue
end
value = value + cValue
end
return value
end
local color_offset = 0
local function ComputeNameColor(pName)
return NAME_COLORS[((GetNameValue(pName) + color_offset) % #NAME_COLORS) + 1]
end