wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 09:44 PM |
Whats the difference between:
Brick = game.Workspace.Part
local Brick = game.Workspace.Part |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
| |
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 09:47 PM |
| Thank you so much :P, but what is different about being local? |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 25 Jan 2014 09:50 PM |
well im not the best at explaining but...
local is like referred to a certain thing and not local is like server-wide so say u use a local script, it refers to a single player or a single thing instead of every player or every object, sorry i suck at explaining |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 09:52 PM |
| Yea, sorry, I got no useful information out of that.. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 10:01 PM |
| local variables can only be accessed by things in the same scope |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 10:03 PM |
| ANother question, and thank by the way.. Do people say gooey or gee-you-eye for GUI? |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 10:04 PM |
| And what do you mean by scope? Same function, same script, same if statement, same game? |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 10:04 PM |
gai-ee
LOL
do you even know what scopes are
function scope() local p = 2 print(p) --> prints 2 end
print(p) -->prints nil |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 10:05 PM |
| Did not know.. Well I didnt know another term for a function.. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 10:06 PM |
it's not another term for function
and gui is pronounced gooey for me |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 10:06 PM |
| Man, this new ROBLOX is crazy! Back in my dau GUIs didnt have rotations! Hooligans! |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 25 Jan 2014 10:07 PM |
| I say gee-you-eye just because I thing gooey is a weird word, unlike chinchilla. Awesome word. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 10:09 PM |
a scope is a block of code where variables are declared ie.
for i = 1, 5 do local x = 5 end
local is where it can only be accessed in that scope without local is where it can be accessed throughout the whole script, making it global. with _G makes it global throughout the whole game
nuff said |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
| |
|
|
| 25 Jan 2014 10:43 PM |
while wait() do --Starts a scope (Lets call it scope1) if true then --Starts scope2, this is within scope1 for i = 1, 10 do --Scope3, within scope2, within scope1 end--Ends scope3 end--Ends scope2 end--Ends scope1
If a scope is within another scope, the local variable is also carried to the next scope
if true then if true then local ScopeTest = "lol" if true then print(ScopeTest) --lol end end print(ScopeTest) --nil end
|
|
|
| Report Abuse |
|
|