generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: RemoteFunction

Previous Thread :: Next Thread 
Xeptix is not online. 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 is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
04 Oct 2013 02:19 PM
Yes, but it has InvokeClient and InvokeServer instead.
Report Abuse
Xeptix is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
04 Oct 2013 02:24 PM
InvokeClient(Instance player, yourstuff,moreofyourstuff) from a whatever

OnInvokeClient from a localscript.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
04 Oct 2013 02:24 PM
And I doubt it. It depends on what can be replicated...
Report Abuse
Xeptix is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
04 Oct 2013 02:27 PM
Probably. But why..?
Report Abuse
Xeptix is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
04 Oct 2013 02:39 PM
No player for InvokeServer, but you COULD pass the player as one of the arguments.
Report Abuse
Xeptix is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image