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: A question about Lua functions

Previous Thread :: Next Thread 
SCS is not online. SCS
Forum Moderator
Joined: 24 Jun 2008
Total Posts: 10075
13 Apr 2012 12:21 AM
What is the difference between connecting functions regularly and anonymously, and which one works better?
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
13 Apr 2012 12:31 AM
I haven never found a situation where I *needed* to connect a function by a specific way but it really does not matter what you do. Most scripters I see use anonymous functions to save typing but the best option would probably be connecting a local function and deleting it from memory right after

local foo
foo = function() --[[myCode]] end
object.Event:connect(foo)
foo = nil

I'd suggest not worrying about which one is better since you probably won't find a situation where using a defined function over anon(idk how to spell) would matter but yeah juust do whatever you like best/makes sense to you
Report Abuse
SCS is not online. SCS
Forum Moderator
Joined: 24 Jun 2008
Total Posts: 10075
13 Apr 2012 12:33 AM
Thank you for your informative reply. It was very helpful.
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