Help with Messaging Service

Alright so to keep it simple and short, I have looked at a variety of different articles and was wondering how to communicate with other players in other servers since the menu is a single player game. So this is what I have tried.

I have tried with 2 accounts on separate servers and nothing seems to happen, let me know if I am doing anything wrong!

Are you subscribing to the topic?

No I am not, but I will try that. I thought you use either or

ive done this but all it did was show a table, I am not really sure how to connect it to chat service

It prints a table because you published a table.

Incorrect, Test is the topic, and the message is the second parameter. Here is the API Reference for MessagingService for further reference.

sorry i made a mistake im writing some code now to help

You don’t subscribe everytime someone joins, you do it once…
Please read the wiki

Okay this should work you can also use a remote event which then in a local script you can add some code for adding a system message using game:service(“StarterGui”):SetCore() (Wont explain unless you want) or you can leave it as it is. However you must use filtering or your game will get moderated.

ChatInAllServers.lua (1.2 KB)

That doesn’t exist…? Do you know what you’re talking about?

oh god another typo lol

thanks for correcting me

my pc is messed up and i cannot view this, tosses it into a word doc instead of the proper file

does chat service take tables as input?

to be honest i don’t know :thinking:

i’ve taken a look at this and tried the sample code, maybe I am doing something wrong.

I’ll do some further investigation into this later as I have had little to eat today and am running on fumes. Thank you

hang on buddy i will re paste the script for you here seeing you said your pc messed up

local MessagingService = game:service(“MessagingService”)
local ChatService = require(game.ServerScriptService:WaitForChild(“ChatServiceRunner”):WaitForChild(“ChatService”))
if not ChatService:GetChannel(“All”) then
while true do
local ChannelName = ChatService.ChannelAdded:Wait()
if ChannelName == “All” then
break
else
end
end
end
local Server = ChatService:AddSpeaker(“Server”)
Server:JoinChannel(“All”)
Server:SetExtraData(“NameColor”,Color3.fromRGB(255,0,0))
Server:SetExtraData(“ChatColor”,Color3.fromRGB(255,255,255))
MessagingService:SubscribeAsync(“Test”,function(message)
local Player = message.Data:split(“)(Player:”)[2]:split(“)”)[1]
local Message = message.Data:split(“(Message:”)[2]:split(“)(Player:”)[1]
if game.Players:FindFirstChild(Player) then
return
end
Server:SayMessage(“[”…Player…“]: “…Message,“All”)
end)
repeat
wait()
until #game.Players:players() > 0
for _,p in pairs(game.Players:players()) do
p.Chatted:Connect(function(msg)
MessagingService:PublishAsync(“Test”,”(Message:”…msg…“)(Player:”…p.Name…“)”)
end)
end
game.Players.PlayerAdded:Connect(function(p)
p.Chatted:Connect(function(msg)
MessagingService:PublishAsync(“Test”,“(Message:”…msg…“)(Player:”…p.Name…“)”)
end)
end)

Thank you for sending and supplying me with this, although it does not work I will read from it knowing how it should properly be set up. Thanks

1 Like

Right Click it, Open with… Then Select Roblox Studio if it doesn’t show go into studio click File then click Open a File (Unsure of the exact name) then browse to the place file. (For future reference)

it doesnt even show up with the place file or anything at all, doesnt even show with open with.
however i was able to open it with visual studio in the end : )