How to wait for a response from the client?

I know it sounds kind of dumb, but I couldn’t find anything on the internet for this.
My question is, is it possible for the in this case server, to wait for a response from the client. For example:

local response = remotefunction:InvokeClient(player)
– (now there is no response yet, because the client didn’t return anything)
WaitForResponse?

If you don’t understand what I mean, i’ll explain in the comments.

1 Like

Don’t use RemoteFunctions to the client because you have no guarantee that it will ever return. Anyway, if you do invoke to the client, it will yield, meaning your next line of code in that thread won’t execute until it returns.

5 Likes

Information on events here.

In this case, the server will wait for the client to return a value, causing the entire script to pause (yield) until a value is returned. You can add a register command, to do something with the return value after you use InvokeClient(), if the register works, the value has returned successfully.

Well, that was basically my question. Thanks for your response.