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: Is there a point in using a local var outside of a scope?

Previous Thread :: Next Thread 
VisionST is not online. VisionST
Joined: 30 Jun 2015
Total Posts: 384
11 Aug 2015 06:24 PM
by that I mean if it decreases the amount of memory taken up like a local variable in a scope would
Report Abuse
cntkillme123 is not online. cntkillme123
Joined: 10 Feb 2013
Total Posts: 539
11 Aug 2015 06:26 PM
It's more efficient, always use local variables when you can, unless you know what you're doing.
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
11 Aug 2015 06:27 PM
Global values take an extra Lua instruction to reference.
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
11 Aug 2015 06:27 PM
define it before like

local var

then globally in the scope

Fishguy100 frames. Do not trust.
Report Abuse
sonicdiablo is not online. sonicdiablo
Joined: 05 Feb 2009
Total Posts: 1661
11 Aug 2015 06:36 PM
Well, as some said, it is faster to access local variables.

Also, you can make sandboxes(well, not in rblx.lua ..)

(in scopes)
closures are useful to make iterators or some sorts of 'static' variables.
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
11 Aug 2015 06:40 PM
"Also, you can make sandboxes(well, not in rblx.lua ..)"

yes u can

Fishguy100 frames. Do not trust.
Report Abuse
cntkillme123 is not online. cntkillme123
Joined: 10 Feb 2013
Total Posts: 539
11 Aug 2015 06:43 PM
"closures are useful to make iterators or some sorts of 'static' variables."
Is that a joke? You use closures 24/7, you just don't know it >:)
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
11 Aug 2015 06:47 PM
I never use closures

never


I don't need a siggy
Report Abuse
cntkillme123 is not online. cntkillme123
Joined: 10 Feb 2013
Total Posts: 539
11 Aug 2015 06:48 PM
Yes you do, unless you never call or create functions.
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
11 Aug 2015 06:48 PM
I do

but they just don't seem to work


I don't need a siggy
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
11 Aug 2015 07:22 PM
Uhm, I never use closures because I always explicitly and inefficiently inject and recall from the active environment.
Report Abuse
cntkillme123 is not online. cntkillme123
Joined: 10 Feb 2013
Total Posts: 539
11 Aug 2015 07:25 PM
You do use closures, I've seen you create and call functions. You probably just don't use upvalues
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