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
 

Should I use a RemoteFunction or a RemoteEvent?

Previous Thread :: Next Thread 
jewelycat is not online. 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 is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
26 Nov 2013 04:33 PM
:u
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
26 Nov 2013 04:38 PM
where da scr0ptors at?
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
26 Nov 2013 07:37 PM
pls
Report Abuse
cntkillme is not online. 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 is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
26 Nov 2013 08:48 PM
but they're interchangeable...
Report Abuse
cntkillme is not online. 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 is not online. 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 is not online. 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 is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
27 Nov 2013 12:54 AM
ok
Report Abuse
adark is not online. 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
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