Help to make announcement system global

Hello, I need help making a option where in my announcement system it says the announcement globally. Globally as in all running game servers.

Anyways, any help would be great. I’ve done all the work to make the announcement now I just have to do is make it play in all servers.

Code

Activation Script, its a local script.

script.Parent.MouseButton1Click:Connect(function()
	local textbox = script.Parent.Parent.Announce.Text
		
	game.ReplicatedStorage.GlobalNotify:FireServer(textbox)
	
end)

Handler

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Variables
local RemoteEvent = ReplicatedStorage.GlobalNotify

--//Functions
RemoteEvent.OnServerEvent:Connect(function(player, text)
	RemoteEvent:FireAllClients(text, player.Name)
end)

main bit, local script

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Variables
local RemoteEvent = ReplicatedStorage.GlobalNotify

--//Functions
RemoteEvent.OnServerEvent:Connect(function(player, text)
	RemoteEvent:FireAllClients(text, player.Name)
end)

Event Handler thing

Event Handler
--Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

--Variables
local RemoteEvent = ReplicatedStorage.GlobalNotify
local TextLabel = script.Parent
local frame = script.Parent.Parent.Parent
local line = script.Parent.Parent.Parent.Frame
local title = script.Parent.Parent.Parent.top.TextLabel

--Functions
RemoteEvent.OnClientEvent:Connect(function(text, player)
	TextLabel.Text = text
	
	title.Text = "Global Notification from "..player.."."
	local TextTransparency = TweenService:Create(TextLabel, TweenInfo.new(1, Enum.EasingStyle.Quint), {TextTransparency = 0})
	TextTransparency:Play()
	
	local TextTransparency2 = TweenService:Create(title, TweenInfo.new(1, Enum.EasingStyle.Quint), {TextTransparency = 0})
	TextTransparency2:Play()

	local BackgroundTransparency = TweenService:Create(frame, TweenInfo.new(1, Enum.EasingStyle.Quint), {BackgroundTransparency = 0})
	BackgroundTransparency:Play()
	
	local TextTransparency2 = TweenService:Create(title, TweenInfo.new(1, Enum.EasingStyle.Quint), {TextTransparency = 0})
	TextTransparency2:Play()
	
	local BackgroundTransparency = TweenService:Create(line, TweenInfo.new(1, Enum.EasingStyle.Quint), {BackgroundTransparency = 0})
	BackgroundTransparency:Play()

	task.wait(5)
	
	local TextTransparency = TweenService:Create(TextLabel, TweenInfo.new(1, Enum.EasingStyle.Quint), {TextTransparency = 1})
	TextTransparency:Play()
	
	local TextTransparency2 = TweenService:Create(title, TweenInfo.new(1, Enum.EasingStyle.Quint), {TextTransparency = 1})
	TextTransparency2:Play()

	local BackgroundTransparency = TweenService:Create(frame, TweenInfo.new(1, Enum.EasingStyle.Quint), {BackgroundTransparency = 1})
	BackgroundTransparency:Play()
	
	local BackgroundTransparency = TweenService:Create(line, TweenInfo.new(1, Enum.EasingStyle.Quint), {BackgroundTransparency = 1})
	BackgroundTransparency:Play()
end)

Anyways, I made this post because I don’t know how to make an announcement appear in all the servers of a game at the same time. So please help me in any way you can :heart:

Try using MessagingService

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MessagingService = game:GetService("MessagingService")

--//Variables
local RemoteEvent = ReplicatedStorage.GlobalNotify

--//Functions
RemoteEvent.OnServerEvent:Connect(function(player, text)
	MessagingService:PublishAsync("announcement", {
        message = tostring(text),
        plr = player.Name
    })
end)

MessagingService:SubscribeAsync("announcement", function(sentData)
    local data = sentData.Data
    RemoteEvent:FireAllClients(data.message, data.plr)
end)
1 Like

It says MessagingService is disconnected, how to I connect it?

1 Like

Did you try it in Studio, because MessagingService does not work in Studio try joining your game normally and test if it is working

1 Like

It worked, tysm.

damn text minimum limit lol

1 Like

You’re welcome!

characterlimits

1 Like

Actualy, MessagingService does work in studio, i have tried it in studio and it replicates what i sent to even real-game servers

1 Like

Really, it actually didn’t work for me in Studio glad it’s working for you :smile:

2 Likes