Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can Remote or Bindable Functions work between 2 Clients?

Asked by
Xduel 211 Moderation Voter
8 years ago

So I have a LocalScript in one Player, and a LocalScript in another Player. From the LocalScript in one Player, it is supposed to pass a function containing an item to the Other player, where the item can be put into that players CurrentCamera from their LocalScript.

But from what I'm reading on the Wiki, this couldn't happen with Bindable or Remote functions. is this true, and if so is there a work around?

2
just use a serverscript as the middleman lukeb50 631 — 8y
0
^^^^ theCJarmy7 1293 — 8y
0
So a Remote Function to ServerScript, and when that activates send the function to the other LocalScript? Seems Legit. Thanks! Xduel 211 — 8y

2 answers

Log in to vote
0
Answered by
Xduel 211 Moderation Voter
8 years ago

-- Answered by Lukeb50 in Comments

Ad
Log in to vote
0
Answered by 8 years ago

Yes
Technically

As mentioned by Luke, you can use the server as a middleman. Consider this proxy function:

RF.OnServerInvoke = function(p,t,...)
  return RF:InvokeClient(t,p,...);
end;

Which is used by the (invoking) client as

RF:InvokeServer(targetPlayer, ...);

And handled by the receiving client as

RF.OnClientInvoke = function(invokingPlayer, ...)
  return ... -- Code here and all
end;

However, it should be noted that you can not send a function over the network as your question suggests you're attempting to do.

Answer this question