Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Change all of the players' GUI text at once?

I'm making a message banner that appears at the top of the screen. This message gets updated using http service so I can send live alerts to all players (like when the the game will shut down for an update). This is my script so far, it is placed in starterGui which means this script will be placed in every single player.


while true do

wait(15)

local http = game.HttpService

local url = "http://thingsfromfoboh.tk/ImportantMessage.txt"
local message = http:GetAsync(url, false)

script.Parent.Text = message

end

The problem with this script is that it must request this information for every single player in the game. I plan to use a lot of http service in my game but there is a 500 http requests per minute limit and it would be more efficient if the game only requests once and then changes all of the player's GUI text.

I realize that I didn't need to throw in all of that http nonsense for my simple question, but I thought this was a cool idea to make this kind of alert system, which is something a lot of constantly updating games should have, so I decided to share.

1 comment

0

You can always have it update a StringValue and when that value gets changed it updates it for everyone. That way it's only 1 request every time you want to put out a message.

1 answer

✓ Accepted answer
while true do

wait(15)

local http = game.HttpService

local url = "http://thingsfromfoboh.tk/ImportantMessage.txt"
local message = http:GetAsync(url, false)

for k,p in pairs(game.Players:GetPlayers()) do
p.PlayerGui.ScreenGui.TextLabel.Text=message -- This is obviously not the right path, you can edit it

end


1 comment

0

yes, exactly what I was looking for, Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.