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 » Scripting Helpers
Home Search
 

Re: Variables

Previous Thread :: Next Thread 
wetrel is not online. 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 is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
25 Jan 2014 09:45 PM
ones local ones not lol
Report Abuse
wetrel is not online. 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 is not online. 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 is not online. 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
alexthemongolian is not online. alexthemongolian
Joined: 23 Mar 2011
Total Posts: 655
25 Jan 2014 10:01 PM
local variables can only be accessed by things in the same scope
Report Abuse
wetrel is not online. 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 is not online. 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
alexthemongolian is not online. alexthemongolian
Joined: 23 Mar 2011
Total Posts: 655
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 is not online. 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
alexthemongolian is not online. alexthemongolian
Joined: 23 Mar 2011
Total Posts: 655
25 Jan 2014 10:06 PM
it's not another term for function

and gui is pronounced
gooey for me
Report Abuse
wetrel is not online. 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 is not online. 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
alexthemongolian is not online. alexthemongolian
Joined: 23 Mar 2011
Total Posts: 655
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 is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
25 Jan 2014 10:40 PM
I say gee
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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