jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 26 Nov 2013 04:24 PM |
If I want the client to launch a function through the server, what's the difference in using these two?
I could do what I'm trying to do by either Invoking a RemoteFunction or Firing a RemoteEvent, which would be more efficient to use? |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Nov 2013 07:41 PM |
remote functions are for functions remove events are for events
Is that not obvious... |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 26 Nov 2013 08:48 PM |
| but they're interchangeable... |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Nov 2013 08:56 PM |
| It depends what you need to use it for... |
|
|
| Report Abuse |
|
|
Kuroki
|
  |
| Joined: 27 Dec 2009 |
| Total Posts: 18058 |
|
|
| 26 Nov 2013 09:01 PM |
Functions are usually a set of instructions for the game to perform.
Events are used to trigger functions mostly. Events fire only when special requirements are met.
You'd need to use both if you want something to happen when a brick is removed from the game, for example. |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 26 Nov 2013 09:23 PM |
Except RemoteEvents don't seem to function like actual events.. at least not on the wiki?
It just seems to be a function...
function onEvent(...) local table = {...} print("Number of arguments: " .. #table) print("First argument: " .. table[1]) print("Last argument: " .. table[#table]) print(...) end local event = Instance.new("BindableEvent") event.Parent = Workspace event.Event:connect(onEvent)
event:Fire("one", "two", "three") |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 27 Nov 2013 02:06 AM |
Use RemoteEvents when you want to be able to yield (wait()) in whatever you're firing.
Use RemoteFunctions when you want to return data, but be warned that you can't yield.
Neither is more efficient than the other, it all comes down to what you need to do. |
|
|
| Report Abuse |
|
|