Hi, I am trying to make a game like the Disguises gamemode from MM2 and I can’t figure out how to make the players anonymous. Please help.
I don’t play much MM2, so is this “Chat” in the game chat?
Well, for example when a player chats their name gets turned into another name like: “CoolGamer123” becomes “Josh”.
Consider using Prefix in the chat. Basically from this post from roblox:
This is what they do for a VIP Tag
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player:GetAttribute("isVIP") == true then
props.PrefixText = "<font color='#F5CD30'>[VIP]</font> " .. message.PrefixText
end
end
return props
end
However I think we can change this script and do:
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local props = Instance.new("TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
props.PrefixText = "Anonymous" -- If you want different names for each player, then replace with your own system and pick a new name for each players
end
return props
end
Please make sure this script is a local script inside StarterPlayerScripts. Also use the next chat system TextChatService
That is perfect! I appreaciate the help! Let me try it.
Thanks for the help but the script isn’t working. Chats still show up like this:
You made sure to do all of this?
Yes, I sure did as you can see here.
That is in ServerScript Service. It needs to be in StarterPlayer < StarterPlayerScripts
It works! Sorry if I am a bit of an idiot lol. Thanks a lot!
Could you use a custom chat box and then use Roblox filtering? Just use a text box, and make it able to create a text label using Instance.new
that contains the text.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.