of     1   

Dondonini
#59090001Sunday, December 04, 2011 5:45 PM GMT

IDK what it does. local Blah = "IDK WHAT LOCAL DO!!" What does it do and what is the difference between using "local" and not using it? Please answer and thanks if you do! :D -=[ dondonini Productions ® ]=-
Dondonini
#59090241Sunday, December 04, 2011 5:49 PM GMT

I think this has a lot of grammar mistakes. Don't talk about it please! -=[ dondonini Productions ® ]=-
theburnboss
#59090654Sunday, December 04, 2011 5:58 PM GMT

local Blah = "IDK WHAT LOCAL DO!!" print(Blah) now it does something.
pokelord910
#59090781Sunday, December 04, 2011 6:00 PM GMT

local w = game.Workspace means that in this script ONLY the workspace can be refferred to by simply using w a more practical, common use would be local p = Instance.new("Part", game.Workspace)
Dondonini
#59090799Sunday, December 04, 2011 6:01 PM GMT

@Theburnboss Ummm... that doesn't tell what is the difference between using "local" and not using it. -=[ dondonini Productions ® ]=-
su8
#59090862Sunday, December 04, 2011 6:02 PM GMT

@pokelord910, Are you sure, "in this script ONLY".. Because aren't all variables in script only for that script usage :P?
Dondonini
#59090962Sunday, December 04, 2011 6:04 PM GMT

I think I'm starting to get the idea. Thanks! :D -=[ dondonini Productions ® ]=-
TheLuaWeaver
#59092142Sunday, December 04, 2011 6:23 PM GMT

No, no. Local is for the function, loop, conditional etc. it's in. function local() local t="LOLHAX" end print(t) Results in an error. Nonlocal means it can be accessed by all things in the script. function nonlocal() t="LOLHAX" end print(t) Prints "LOLHAX".
Dondonini
#59130647Monday, December 05, 2011 7:13 AM GMT

@BrandonFireflower ooOOOOOOOOOooohhh!!!!! I GET IT NOW!!! Thanks!! :DD -=[ dondonini Productions ® ]=-
Yionee
#59131925Monday, December 05, 2011 10:26 AM GMT

@ Brandon, creating a function with the name "local" has nothing to do with local and global variables. @ dondonini, if you put "local" in front of a variable, that variable can only be accessed in the script that you assigned the variable in. If you don't use the word "local" then any script can see that variable. (I tried to word it simple as I could to help you understand)
Dondonini
#59154158Tuesday, December 06, 2011 12:24 AM GMT

@yionee OK thanks! :D -=[ dondonini Productions ® ]=-
SeanMichaell
#59155737Tuesday, December 06, 2011 12:44 AM GMT

plus if you use local you can use the varible and change it later in the script example while true do local text = ":D" print(text) wait(4) local text = ":(" print(text) end with local you can chnage what the varible represents at any point in the script.
Spectrumw
#59156505Tuesday, December 06, 2011 12:54 AM GMT

@Text No. You can do that with any variable, that's the reason they are called 'variables'. @OP If you use 'local' when assigning a variable, that variable will only be avaliable in the specific snipet of code where it was created at. I.E; if true then   local Var = 'Hello'   print(Var) end print(Var) >Hello >nil
jav2612
#59157296Tuesday, December 06, 2011 1:04 AM GMT

yosuppeeps
#59897847Wednesday, December 21, 2011 12:26 AM GMT

Well I for one use local in the instance that I deal with things outside the scripts parrent that can be generalized. Like kill scripts and regen buttons. Mostly kill script then I narrow it dow by adding a couple of bools and the ine would look like script.Parent.Touched:connect(function(part) -- All characters have a Humanoid object -- If the model has one, it is a character local h = part.Parent:findFirstChild("Humanoid") -- Find Humanoids in whatever touched this
Pyzothon
#59898444Wednesday, December 21, 2011 12:35 AM GMT

Local variables are accessed faster than normal variables, take up less space, and are generally used more often than global variables (which are the default variables). But, local variables only exist in there scope. A scope starts whenever you use the keywords do, if, and function.     local a = 5     if a == 5 then         local b = 10         print(b)     end     print(a)     print(b)  > 10  > 5  > nil The third result is nil because the variable b's scope ended, thus making it unaccessable. The only reason it printed the first time is because you printed it inside its scope. Pyzothon, novice scripter/programmer.
AgentFirefox
Top 100 Poster
#59898659Wednesday, December 21, 2011 12:38 AM GMT

Local assigns the scope within the context of the given executable.

    of     1