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: what do i use local for

Previous Thread :: Next Thread 
ZombieAPOCfps is not online. ZombieAPOCfps
Joined: 04 Apr 2013
Total Posts: 12
07 Apr 2013 06:12 PM
I need to know
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
07 Apr 2013 06:13 PM
localising...

Is necessary is you are dealing with a single function that uses some variables being run while others instances of it are running.
Report Abuse
ZombieAPOCfps is not online. ZombieAPOCfps
Joined: 04 Apr 2013
Total Posts: 12
07 Apr 2013 06:19 PM
Oh okay thanks
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
07 Apr 2013 06:20 PM
Its keeps certain variables contained in one scope so that they don't interfere with another scope. They can also be used to avoid being caught by getfenv and will not show up on loadstring threads either.
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
07 Apr 2013 06:24 PM
It's so that variables are kept to one scope, and all the scopes within that scope.

varA = 12
for i = 1, 10 do
local varB = 32
print(varA, varB) -- 12 32
varB = varB + 1
end
print(varA, varB) -- 12 nil
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
07 Apr 2013 06:26 PM
Locals are also faster to access than the global scope, but you are limited to 250 (or 200, I think) per scope.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
07 Apr 2013 06:26 PM
http://wiki.roblox.com/index.php/Scope
Report Abuse
crusada91 is not online. crusada91
Joined: 04 Sep 2010
Total Posts: 684
07 Apr 2013 06:27 PM
@Dr01d3k4
I suspect 255
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
07 Apr 2013 06:29 PM
From llimits.h (I believe this is Lua 5.2.1 though)

/*
** maximum depth for nested C calls and syntactical nested non-terminals
** in a program. (Value must fit in an unsigned short int.)
*/
#if !defined(LUAI_MAXCCALLS)
#define LUAI_MAXCCALLS 200
#endif

/* maximum stack for a Lua function */
#define MAXSTACK 250

Report Abuse
crusada91 is not online. crusada91
Joined: 04 Sep 2010
Total Posts: 684
07 Apr 2013 06:30 PM
Nvm, different version
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