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: i am going through hell trying to understand local values.

Previous Thread :: Next Thread 
majesticflyingfox is not online. majesticflyingfox
Joined: 10 Dec 2015
Total Posts: 186
07 Jan 2016 07:47 PM
you know, like:

"local cat =

do
local cat =
print(cat)
end"

or something idk i am getting pissed off
Report Abuse
Link5659 is not online. Link5659
Joined: 04 Jun 2012
Total Posts: 4525
07 Jan 2016 07:49 PM
local lol =
{
game.Workspace.lol
game.Workspace.lol1
game.Workspace.lol2
game.Workspace.lol3
}
Report Abuse
DermonDarble is not online. DermonDarble
Joined: 04 Jun 2015
Total Posts: 2576
07 Jan 2016 07:57 PM
it helps to understand scope

/Domingo en fuego/
Report Abuse
Darkenus is not online. Darkenus
Joined: 17 Jul 2014
Total Posts: 1997
07 Jan 2016 08:03 PM
It helps to understand what 'local' really means, by Google-ing it:

Google > 'definition of local'
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
07 Jan 2016 08:04 PM
like dermon said, read this: http://wiki.roblox.com/index.php?title=Scope
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
07 Jan 2016 08:07 PM
You need to understand what scopes are.

Local variables themselves are just variables that can only be accessed by code in the same scope. Local variables can be quite useful in some situations, and are faster to read from.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
07 Jan 2016 08:36 PM
function add(x, y)
local sum = x + y
print(sum)
end

'sum' is a local variable inside of the function add. It can't be accessed outside of add.
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