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 » Scripters
Home Search
 

Re: Can you put a function inside of a function?

Previous Thread :: Next Thread 
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Oct 2015 08:56 PM
Like

function dosomething()
--code
function dosomethingelse()
--code
end
dosomethingelse()
end

u sicko!
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
02 Oct 2015 09:03 PM
yes
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
02 Oct 2015 09:11 PM
Thank the Lord.
Thanks.

u sicko!
Report Abuse
sharpchain1 is not online. sharpchain1
Joined: 05 Aug 2013
Total Posts: 1009
02 Oct 2015 09:16 PM
Yes you can but you really shouldn't things can get messy
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
02 Oct 2015 09:22 PM
It won't get messy at all depending on how you write it. Closures are a very useful concept.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Oct 2015 09:23 PM
99% of the time, it makes your code less efficient because it requires closure creations every time you call the enclosing function.
Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
02 Oct 2015 09:36 PM
I think doing that is very helpful

and I also don't think that a 0.1 second delay is really anything to complain about when you do so


for me, it just makes things a lot more efficient and easier to write
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Oct 2015 09:37 PM
'for me, it just makes things a lot more efficient and easier to write'
Less efficient and easier to write (arguably, it's preference)

But yes, if it's easier to read and use then do it.
Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
02 Oct 2015 09:40 PM
whenever I do it, it is probably 100 times easier and more efficient for me than using a crap load of other things just to do one thing that I could've done by putting functions in functions
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Oct 2015 10:29 PM
No, you're just doing something wrong if it requires you to do 'crap load of other things'.
Report Abuse
vastqud is not online. vastqud
Joined: 10 Sep 2011
Total Posts: 2464
03 Oct 2015 08:18 AM
no I wasn't doing anything wrong


I just think that it requires much more time and skill to not put a function in a function
Report Abuse
iWindowz is not online. iWindowz
Joined: 05 Jan 2013
Total Posts: 1809
03 Oct 2015 08:26 AM
yes
how to make it not look messy:

#code
function hi()
-- if you want a function in here, it's smarter if you tab it once.
function hello()
--code
end
--code
end

ofc you need roblox+ to properly view this


#code --hello there!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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