Xeptix
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 1115 |
|
|
| 04 Oct 2013 02:13 PM |
| Is the use of the new RemoteFunction class similar to BindableFunction? |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 04 Oct 2013 02:19 PM |
What's a RemoteFunction?
Searched it on the wiki, gives quite an odd explanation. Or not really an explanation. :c |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 02:19 PM |
| Yes, but it has InvokeClient and InvokeServer instead. |
|
|
| Report Abuse |
|
|
Xeptix
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 1115 |
|
|
| 04 Oct 2013 02:21 PM |
Wait so how I would I use it?
workspace.RemoveFunction:InvokeClient("stuff","moar stuff")
when using a localscript?
and if I were to access _G in the invoke function, and invoke it from a client, would it index the client-sided _G? |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 02:24 PM |
InvokeClient(Instance player, yourstuff,moreofyourstuff) from a whatever
OnInvokeClient from a localscript. |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 02:24 PM |
| And I doubt it. It depends on what can be replicated... |
|
|
| Report Abuse |
|
|
Xeptix
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 1115 |
|
|
| 04 Oct 2013 02:25 PM |
| OnInvokeClient has to be assigned from a LocalScript? if so that kinda kills the purpose for me... |
|
|
| Report Abuse |
|
|
| |
|
Xeptix
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 1115 |
|
|
| 04 Oct 2013 02:30 PM |
| I'm trying to make client to server communication, since the script A) has all the game data B) can use data persistance and C) can use badgeservice |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 02:36 PM |
In a LocalScript:
function.OnClientInvoke = func
In a normal script/possible other players LocalScript:
function.InvokeClient(player, args)
How is it not useful? |
|
|
| Report Abuse |
|
|
Xeptix
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 1115 |
|
|
| 04 Oct 2013 02:38 PM |
And in reverse?
function.OnServerInvoke = func
In a localscript:
function.InvokeServer(player,args) |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 02:39 PM |
| No player for InvokeServer, but you COULD pass the player as one of the arguments. |
|
|
| Report Abuse |
|
|
Xeptix
|
  |
| Joined: 14 Mar 2013 |
| Total Posts: 1115 |
|
|
| 04 Oct 2013 02:41 PM |
Alright, I figured out the correct way to use it.
in a script:
_G.test = 1
local RemoteFunction = workspace:WaitForChild("RemoteFunction") RemoteFunction.OnServerInvoke = function(Player,Action,String) print(Player,Action,String) print(_G.test) end
in a localscript:
workspace.RemoteFunction.InvokeServer(workspace.RemoteFunction,"test","test4")
printed:
Player1 test test4 1 |
|
|
| Report Abuse |
|
|