I have a script that would show each player a message after a certain time. After the message appears, some code is run. The more players i have in game, the longer it takes. I tested on studio to see what happens with 2 players and i saw that the Gui shows up for one player at a time. I want it to show for all players at the SAME time. Anyone know what i need to do to fix this?
function Message()
for i,v in pairs(game.Players:GetPlayers()) do
local msg = v:WaitForChild("PlayerGui").ScreenGui.Message
message.Visible = true
wait(3)
message.Visible = false
end
end
while true do
wait(20)
Message()
--Code to run
end
Also, this is a normal ServerScript in Workspace.
Any help would be appreciated!

11 comments
This doesn't seem to be working for me. When i test with 2 players on studio, nothing happens. When i test in game with 2 players, I get an error saying ScreenGui is not a valid member of PlayerGui. I tried changing it to :WaitForChild("ScreenGui") but it gives me infinite yield possible.
Yup. Let me edit this.
How exactly do i use the RemoteEvent to access the players Gui? I haven't used this before so i'm not so familiar with it.
You just put a RemoteEvents in replicated storage and follow the tutorial. There are many tutorials out there to help you understand remote events, but basically they're like a portal, or connection, that lets the Server interact directly with the Client.
All you said was to put the remoteEvent inside of replicated storage and then use :FireAllClients() but it doesn't look like it's interacting with the Gui's?
FireAllClients() sends a signal to all the clients, signals which the LocalScripts inside the clients can pick up on, and then they can do whatever they want with the information the signal gives.
So you need both a Regular Script and a Local Script for this process to work.
Okay so i just found out that FilteringEnabled was ENABLED. I disabled it and now the script works without the remoteEvents thing you said.
If you're still confused, I recommend watching this: https://www.youtube.com/watch?v=4Dc_bri9mjs
Okay, thank you.
Well, without Filtering, you're game won't show for people under 13, and the game is super vulnerable to exploits.