New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

Anyone know anything about the ChatSystem? I don't understand it at all..

Asked by 3 months ago
Edited 3 months ago

I was at this game called Ragdoll System Test ( THIS IS JUST FOUR QUESTIONS I'M ASKING FOR ANY SCRIPTERS WHO KNOW ABOUT THE CHATSYSTEM AND HOW IT WORKS I saw that if you whisper someone, there is a special box that pops up instead of it being in the general chat. I have two questions.. One) Is this a custom chatsystem & Two) How would this be done? The next question is about chat tags.. is it possible to have it where chat tags can show your group rank? I'm asking because I don't want to put all the time and effort in to do all of this and then I end up finding out that it's not able to be done. Here's the script. game>StarterGui>ChatFont

local ChatSettings = require(game.Chat:WaitForChild('ClientChatModules').ChatSettings)

ChatSettings.WindowResizable = true;
ChatSettings.DefaultFont = Enum.Font.SciFi;
ChatSettings.ChatBarFont = Enum.Font.SciFi;

Honestly, even if I could make it where it gave people a tag stating they were in the group would be nice. MillerrIAm 363 — 3mo
im trying to see, wait throwawayaccount2001 66 — 3mo
alright MillerrIAm 363 — 3mo
View all comments (7 more)
Nearly forgot, its in a local script. MillerrIAm 363 — 3mo
im trying to figure out a solution, but studio isn't loading my places so i cant do anything throwawayaccount2001 66 — 3mo
Do you have a discord? If so, add me MillerrIAm#9898 MillerrIAm 363 — 3mo
i think roblox isn't working right, there is a bar saying so at the top of the home page, i got it to sorta work but it keeps showing [???] throwawayaccount2001 66 — 3mo
game.Players.PlayerAdded calls are not working i think roblox is actually broken todya throwawayaccount2001 66 — 3mo
Oh jesus MillerrIAm 363 — 3mo
your local script works fine throwawayaccount2001 66 — 3mo

1 answer

Log in to vote
Answered by 3 months ago
Edited 3 months ago

Make a ServerScript in ServerScriptService and put this code in (change values as nessacary shown in the comments!)

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local groupId = 000000 -- Group ID here

    while not ChatService:GetSpeaker(player.Name) do wait() end -- Wait till the player's speaker (thing that allows it to chat) exists
    local speaker = ChatService:GetSpeaker(player.Name)
    if player:GetRoleInGroup(groupId) == "Guest" then return end -- Remove this if you want it to do say [Guest] if they player isn't in the group
    speaker:SetExtraData("Tags", {{TagText = player:GetRoleInGroup(groupId), TagColor = Color3.fromRGB(0, 255, 0)}})
    -- Change the values in Color3.fromRGB() for a different tag color

For the whisper chat (do this pre-runtime)(anytime i bold a name you must write it just like that): 1. Insert a Folder into Chat called "ChatModules" 2. Insert a BoolValue into **ChatModules** called "InsertDefaultModules" and set it's value to true 3. Insert a ModuleScript into ChatModules and put this in the module (make sure to make the remote event that the script references!)

local sendPopup = game.ReplicatedStorage.SendWhisperChatPopup -- Reference a remote event
local TextService = game:GetService("TextService") -- Filter messages so they have no swears

local function Run(ChatService)
    local function filterMessage(message, speaker, reciever)
        local filteringResult = TextService:FilterStringAsync(message, speaker.UserId)
        if not game.Chat:CanUserChatAsync(speaker.UserId) or not game.Chat:CanUserChatAsync(reciever.UserId) or not game.Chat:CanUsersChatAsync(speaker.UserId, reciever.UserId) then
            -- Player(s) cannot chat, send back a DONT SEND MESSAGE prompt
            return 0
        return filteringResult:GetChatForUserAsync(reciever.UserId)

    local function whisperCheck(speakerName, message, channelName)
        if string.sub(channelName, 1, 2) == "To" then -- If whisper channel then
            local otherPlayer = game.Players:FindFirstChild(string.sub(channelName, 4)) -- Get the other player
            local speakerPlayer = game.Players:FindFirstChild(speakerName) -- Get the player who said something
            local newMessage
            local succ, err = pcall(function() newMessage = filterMessage(message, speakerPlayer, otherPlayer) end)
            if newMessage == 0 then
                -- Player can't chat
                sendPopup:FireClient(speakerPlayer, "Note", "One of you can't chat!")
                return true
            if err then
                sendPopup:FireClient(speakerPlayer, "Filtering failure", err)
                return true
            -- We can send message
            sendPopup:FireClient(otherPlayer, speakerName, newMessage)
            return true
        return false

    ChatService:RegisterProcessCommandsFunction("whisperCheck", whisperCheck)

return Run
  1. Next, make a ScreenGui in StarterGui
  2. Insert a LocalScript into the ScreenGui and put this in it (remember to reference the remote event you made earlier where you need to!)
local inSession = false -- if another chat is on screen
local START_POS =, -300, 1, 0)
local END_POS =, 0, 1, 0)
local SIZE =, 200, 0, 50)
local ANCHOR_POINT =,1)
local TIME = 0.2
local doneEvent ="BindableEvent", script.Parent)

local function showLabel(speakerName, message)
    if not inSession then
        inSession = true
        local label ="TextLabel", script.Parent)
        label.Name = "WhisperBox"
        label.BackgroundColor3 = Color3.fromRGB(0,0,0)
        label.BackgroundTransparency = 0.5
        label.BorderSizePixel = 0
        label.Font = Enum.Font.SciFi
        label.TextScaled = true
        label.TextColor3 = Color3.fromRGB(255,255,255)
        label.AnchorPoint = ANCHOR_POINT
        label.Position = START_POS
        label.Size = SIZE
        label.Text = speakerName..": "..message
        label:TweenPosition(END_POS, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, TIME, true)
        wait(5 + TIME)
        label:TweenPosition(START_POS, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, TIME, true)
        label = nil
        inSession = false
        showLabel(speakerName, message)


I tested it and it works!


Answer this question