Do RemoteFunctions yield forever?

like if I did

local Returned = Function:InvokeClient(person)

and the client never returned anything, would it just yield the thread forever or is there a timeout after a certain period of time?

1 Like

According to the wiki, yes.

https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events#Difference_between_Remote_Events_and_Functions

Warning: Invocations (both InvokeServer and InvokeClient will yield until to corresponding callback has been defined. If the callback is never set, then the Script or LocalScript that invoked will not resume execution.

3 Likes

This is a reason it is known as bad practice to invoke the client. Infinite yields do happen and will cause issues.

2 Likes

I don’t necessarily think it’s bad practice to use InvokeClient. It really depends on how you’re using it and what your backup plans for terminating a client or the active thread are if there’s too long a timeout. Typically though, if those cases aren’t covered, then yes a pickle has arrived.

3 Likes

On personal experience, I can report that they will timeout when called from the client and no response is given after x amount of time. An error will be thrown in this case.