Invoke all clients?

I want to create a system where it invokes all clients at the same time. However, I want all the clients to be invoked at the same time while still waiting for all the clients to return before unyielding. Is there a way to do this?

You should try not to invoke the client since they can fabricate the data. What are you trying to do?

1 Like

I’m trying to get the client to display the message and for the game to “pause” while they are still reading the message. It’s not actually using the data from the client.

The simply way to invoke an event on all clients is the use the function bellow:

local RemoteFunction = game.ReplicatedStorage["YOUR FUNCTION NAME"]

local function InvokeAllPlayers()
	for _, Player in ipairs(game.Players:GetChildren()) do
		RemoteFunction:InvokeServer("ARGUMENTS HERE")

1 Like

I highly recommend to NEVER invoke from the client as they can easily spoof any information back to the server. Make your game as server-sided as possible.

If you want to display a message I recommend using a Instance boolvalue instead and having a local script listen via .Changed