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

How do I make something that happens in every server? (Globally)

Asked by 8 years ago

Like for example, a Global Message Shout, or a Global Shutdown Message?

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

DataStores

Probably the worst way you could do this would be using DataStores, mainly because of their request liimit. It is something like NumPlayers*10+60. The only way you would be able to use this feature is using a loop constantly checking a value, in intervals of around 30 seconds to a minute.

E.G;

01function setGuis(message) -- function for setting the message
02    for _,v in pairs (game.Players:GetPlayers()) do -- iterates through players
03        local text = v.PlayerGui.MessageGui.Message -- gets the gui to change
04        if message then -- if there is a message
05            text.Visible = true -- shows gui
06            text.Text = message -- sets text
07        else
08            text.Visible = false -- hides gui
09            text.Text = "" -- removes text
10        end
11    end
12end
13 
14local ds = game:GetService("DataStoreService"):GetDataStore("GlobalMessage") -- gets DataStore
15local key = "message" -- gets a key for the DataStore
View all 24 lines...

P.S:

Maybe it isn't as bad as I made it out. It can just be flawed at times, and the request limit isn't so bad when you look at it.


Trello/Other Service

I don't believe there is a request limit for HTTP, so you can use it trello and other services in the same manner I made above.

I haven't tried to use this before, so I can't really help you, but a google search can help you with that. SH also has a useful blog post on that: https://scriptinghelpers.org/blog/logging-errors-with-trello


Hope I helped!

~TDP

Ad

Answer this question