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
 

What is end) ?

Previous Thread :: Next Thread 
BlueHound is not online. BlueHound
Joined: 30 Jan 2012
Total Posts: 1971
19 May 2013 08:51 PM
I've noticed scripts with end) with the ')'
why is that there?
Report Abuse
ArchitectOfEden is not online. ArchitectOfEden
Joined: 05 Jan 2013
Total Posts: 3423
19 May 2013 09:10 PM
[ Content Deleted ]
Report Abuse
Voidion is not online. Voidion
Joined: 01 Aug 2011
Total Posts: 2668
19 May 2013 09:12 PM
They're used to end anonymous functions.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
19 May 2013 09:14 PM
Most of the time, they use it to close a connection thingy:

Event:connect(--open
function()
--stuff
end)--close
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
19 May 2013 09:15 PM
The parenthesis is to close an anonymous function. For example,

a basic function, per se, might look like this:

function onTouch()
--Code
end
script.Parent.Touched:connect(onTouch)

an anonymous looks like this:

script.Parent.Touched:connect(function()
--Code
end)

It more or less eliminates the need for a connection line, and supposedly speeds up the code. I'm not quite sure if it does or does not speed up the code, though. Long story short, it contains the code pertaining to the anonymous function, specified earlier in the coding.

Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 May 2013 09:43 PM
" I'm not quite sure if it does or does not speed up the code"

It really doesn't. People who program in RBX.Lua do it mainly because they already added the connection line in the beginning of the program; so they don't have to add it at the end.

People who program in Lua use anonymous functions for functions that have very little code in them.

ex:

(function(parameter)
print(parameter);
end)("hi")

Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
19 May 2013 09:59 PM
I didn't think it did. That was just something I heard, and I figured I might as well throw it in there. I wasn't sure, so I tried to make sure mis-information wasn't going to be spreaded by stating "I wasn't sure." :P
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
19 May 2013 10:34 PM
"When you write functions the wrong way you have to put it there
use this instead"

The wrong way? It is actually the best way to use functions in which you are connecting.
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
19 May 2013 10:41 PM
^
Report Abuse
ArchitectOfEden is not online. ArchitectOfEden
Joined: 05 Jan 2013
Total Posts: 3423
20 May 2013 12:20 AM
[ Content Deleted ]
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
20 May 2013 12:46 AM
actually connection lines confuse me a lot more than anonymis functions lol
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
20 May 2013 01:33 AM
@BlueHound

BECAUSE WE CANNN!!!
MUAHAHAHAH
Report Abuse
BlueHound is not online. BlueHound
Joined: 30 Jan 2012
Total Posts: 1971
20 May 2013 01:58 AM
Thanks everyone that replied :D
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
21 May 2013 11:39 PM
@Architect,

I never said there was, I'm just saying that way works just as good. If not, better.

Life is an endless nightmare
Report Abuse
reptoslicerguy is not online. reptoslicerguy
Joined: 01 Jan 2010
Total Posts: 2098
22 May 2013 05:06 AM
when i just started scipting like a month ago i thought annonymous functions where useless too
but i wouldnt say that now

now i use them sometimes
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