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

How would one go about making a server-wide message?

Asked by 4 years ago

Hello all, I was wondering how I'd make a message that ALL servers would make, as I'd like to warn players when I shutdown all servers for updates and such. Thanks in advance!

1
I will advise you to read this article https://developer.roblox.com/en-us/api-reference/class/MessagingService JesseSong 3916 — 4y

1 answer

Log in to vote
1
Answered by
9mze 193
4 years ago
Edited 4 years ago

Create a script in ServerScriptService and put the code below inside of it. When you update the message, it will change for all the servers.

local MessagingService = game:GetService("MessagingService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

MessagingService:SubscribeAsync("Global Chat", function(message)
    local msg = message.Data
    local tim = message.Sent
    -- Your code after the message gets updated.
end)

ReplicatedStorage.Events.globalchat.OnServerEvent:connect(function(Player, msg)
    MessagingService:PublishAsync("Global Chat", msg)
end)

You can update the message in Studio or in the game by using 'game:GetService("MessagingService"):PublishAsync("Global Chat", "Your new message.")' or you can create a GUI that will fire the remote 'globalchat'.

1
I'm sure you probably know how to edit it to become like an announcement or so. 9mze 193 — 4y
0
Thanks! This service will definitely help me in the future! Utter_Incompetence 856 — 4y
Ad

Answer this question