Global Announcements That show across all servers?

I created a similar thread about this issue i was having awhile ago and i had the response i was looking for which was to use .OnUpdate() with datastores to do so. However the issue i’m having is that even though i post to the datastore announcements don’t globally show to other users apart from myself.

So far i’ve had no success in creating a global announcements system.

How does it work?
My system should be able to send announcements and important information(text) over a datastore to all active servers and show to all players immediately after the datastore is updated.

Thanks in advance for anyone who is willing to help!
~ Venetrix

3 Likes

In global you’ll want each server to listen for updates. It’s not so much ‘sending’ it to each server, the active servers will try to see whether the message in the datastore has changed and, if it has, display it to users. Since you indicate your attempts were fruitless, it is probably best if you post what you have so far.

4 Likes

I don’t have any attempts that i saved(I stopped trying after a while as i had other projects to complete)

heres a snippet of what it looked like:

--[[
This was written on forums so it might not be perfect
This is how it would've looked when i originally made it.
]]
local DataStoreService = game:GetService("DataStoreService")

local Datastore = DataStoreService:GetDataStore('Announcements')

Datastore.OnUpdate('Alerts',function()
local alert = Datastore:GetAsync('Alerts')
SomeEvent:FireAllClients(alert)
end)
3 Likes

You said the DataStore updates themselves do show on your client though. If the problem lies with the OnUpdate connection this should not happen at all. Is the DataStore you are updating part of the same game that you expect the clients to receive the announcement in? Are the clients that are not being updated giving any errors that prevent the script with the Remote event connection from working?

(I am assuming that Datastore.OnUpdate as opposed to Datastore:OnUpdate is merely a typo in your snippet)

Is the DataStore you are updating part of the same game that you expect the clients to receive the announcement in?

Yes, it’s apart of the same universe.

Are the clients that are not being updated giving any errors that prevent the script with the Remote event connection from working?

There has been no errors that a friend of mine has told me about when i asked them to help test it.

Well first off, the function given to OnUpdate is given the updated value as argument, so an extra call to GetAsynch to get the actual value is not necessary/perhaps unreliable even.

In the current testing setup, are you and other people in the same server where you update the datastore? Otherwise I’d suggest the common debugging practices; add print messages in the client remotes to inform that they did receive an update and what arguments are given, have the server indicate that it’s informing clients and with what value it is updating them and any other means to track down the issue.

Yeah we were in the same server, I’ll see if i can work some more on it and add debugging prints on both client/server to make sure. Thanks for you assistance! :slight_smile:

As far as I remember the function automaticly gave you the newest value of that Datastore. So you can just make a simple announcement script from Server using RemoteEvent to Clients

Edit : it is suggested to add a wait()

Could you explain what you mean + link to where you read this? In general, arbitrary yielding is very bad and something that should be avoided. It typically means you are missing a catch somewhere.

2 Likes

I wasn’t really meant to say that but It’s possible to have UpdateAsync ran at fast rate ( it’s like updated twice at one time ). Unless only him that able to post Global Announcement.

I always use marketplace service and just change the description of a model I own. I check every 60 seconds or so to see if it changes and if it does I show the message.

1 Like