Receiving Server-Sided Input from client

Any ideas on how to detect client input in this manner?

Server (Prompt the player to press a button) -----> Client (Update Gui / detect input) -----> Server (continue to execute code if input happened)

I thought of using remote functions, unfortunately, they discourage using it like this. :confused:

probably just use remote events

Could you give an example for when you would need to do that?

You can use a RemoteEvent for this

  • Server fires to the client to press a button
  • When client presses a button, client fires back to the server
  • Server continues code without any yielding occuring

You can use 1 RemoteEvent for this as well since you can set up OnClientEvent and OnServerEvent for that Remote instead of creating 2 remotes

The reason InvokeClient is usually discouraged is because exploiters can mess with the localscript that contains the OnClientInvoke and make it halt the server since it yields until something is returned

1 Like