I recently got back into development after a few months off. And I’ve noticed that there have been updates with the chat system.
I want to make an introduction system where players have to reveal their names, so that their actual character name + Roblox username will be revealed. I have a script that generates names + surnames and then sets it as the humanoid’s DisplayName. I also have a button that uses the Chat() method, which basically says the player’s display name.
Now here comes the question about it. First off, by using this method, will all players be able to see this, and will it not be only locked to a certain age group? And do the names need to go through chat filtering before being used by the Chat() method?
P.S. Sorry if I put this into the wrong category. I didn’t really know where to put this question.
Hey, even though all the ‘character names’ are developer-preset in studio, your scenario shows that it’s being used as ‘player-communication’, which in Roblox guidelines means that it must be filtered. If you’re planning to send it through to all players, you should use this function. Which will return a TextFilterResult object. You should use the :GetNonChatStringForBroadcast() method and then display accordingly to all clients.
Hope this helps, reply to this if you have anymore questions.
Hello, thank you for your response. (and also sorry for the late reply)
When the player reveals their name, it will be visible only to certain players within a hitbox (this hitbox won’t be very big). Of course, we could speak about a situation that is more likely not to happen, but it still could - where all players would fit in the hitbox. —- In this instance, I’m speaking about the DisplayName being revealed. But I guess the chat message itself would still be visible to everyone nearby, because you can’t really show the message to only specific players if I’m correct. So should I still do the same as you said?
Also, I’m interested in knowing if you also need to do the same process if the chat is reduced (disabling ChatWindowConfiguration Behavior - the chat message history won’t be there)
Oh, and I also forgot to mention if I should use the filtered message with the :Chat() method or make a separate BillboardGui that would display above the player’s head.
If you’re trying to keep things simple, you should still do:GetNonChatStringForBroadcast(). Even if it’s less than all players, this filtering method is preferred. There’s two methods for displaying, either a string filtered for a specific user, or a string filtered for broadcast (to multiple users). Nothing would really change, I would say still keep the same method.