Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] TextChatService System Message Not Sending?

Asked by 1 year ago
Edited 1 year ago

In my game, I am using text chat service. I am trying to add a leave/join message inside the game. I have made it so that when I join or leave the game, it says I joined or left in a different color, however, when I joined the game, nothing gets sent in the chat. The weird thing is, there are no errors in the output console. This is what I have tried.

SERVER

local remoteEvent = game:GetService("ReplicatedStorage").JoinLeaveRE

game.Players.PlayerAdded:Connect(function(plr)
    if (plr.UserId == 1274540012) then
        remoteEvent:FireAllClients(plr,"[OWNER] "..plr.Name.." joined the game!")
    else
        remoteEvent:FireAllClients(plr,plr.Name.." joined the game.")
    end
end)

game.Players.PlayerRemoving:Connect(function(plr)
    if (plr.UserId == 1274540012) then
        remoteEvent:FireAllClients(plr,"[OWNER] "..plr.Name.." left the game.") 
    else
        remoteEvent:FireAllClients(plr,plr.Name.." left the game.")
    end
end)

CLIENT

local remoteEvent = game:GetService("ReplicatedStorage").JoinLeaveRE
local chat = game:GetService("TextChatService")
local channel = chat:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")

remoteEvent.OnClientEvent:Connect(function(plr,message)
    channel:DisplaySystemMessage("<font color='#04D9FF'>"..message.."</font>")
    print("PLEASE WORK")
end)

-- #04D9FF
0
If your not getting errors usually it has to be an error in the script where the remote event was sent to. Not the one that sends the remote event this is just going by my past experiences with remote events. theking66hayday 841 — 1y
0
Hope this helps you find the error. I don't really know much about textchatservice. theking66hayday 841 — 1y
0
I checked both the server and the client but they didn't have any errors. BoiBoi24T 63 — 1y
0
Weird theking66hayday 841 — 1y

2 answers

Log in to vote
1
Answered by 1 year ago

Try using RBXSystem instead of RBXGeneral.

Client

local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("JoinLeaveRE")
local chat = game:GetService("TextChatService")
local channel = chat:WaitForChild("TextChannels"):WaitForChild("RBXSystem")

remoteEvent.OnClientEvent:Connect(function(plr,message)
    channel:DisplaySystemMessage("<font color='#04D9FF'>"..message.."</font>")
    print("PLEASE WORK")
end)

-- #04D9FF
0
It didn't work. BoiBoi24T 63 — 1y
0
Is TextChatService.CreateDefaultChannels set to true? T3_MasterGamer 2189 — 1y
0
Yes BoiBoi24T 63 — 1y
Ad
Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

I figured it out on my own. I just simply added a task.wait(.5) inside OnClientEvent

0
yk you could've just put [SOLVED] in the question title instead of accepting my answer.. T3_MasterGamer 2189 — 1y

Answer this question