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: What is exactly is this?

Previous Thread :: Next Thread 
IdealDev is not online. IdealDev
Joined: 25 Mar 2010
Total Posts: 105
09 Oct 2014 10:19 AM
I see this a lot in game dev livestreams.
_G.somethinghere
First of all, what is it called?
Second, what is it used for and how do I use it?
Please help :c
Report Abuse
AnimeSource is not online. AnimeSource
Joined: 16 Jul 2014
Total Posts: 190
09 Oct 2014 10:22 AM
Its global function allows script connect each other like if you have 2 scripts and in first script you defined a is =1 and you ask script 2 what is 1 it would say its nil value because you didn't define a in second script but if you global it will work.

http://wiki.roblox.com/index.php?title=Global_function
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Oct 2014 10:22 AM
_G is the global variable. Roblox decided they'd mess with it and now you actually have to refer to _G.Variable but whatever
It's a part of the core Lua, and it's where stuff like math and all the string methods come from

To assign something to _G, use _G.Var = Something
To read from _G, use _G.Var

To assign a function to _G, use _G.Func = function(args) code end

I trust you understand Lua, and know I'm not literal with my naming of Var and Func. Also code.
Report Abuse
LeitrisArcade is not online. LeitrisArcade
Joined: 15 May 2010
Total Posts: 2127
09 Oct 2014 10:23 AM
Ooh, I never knew Roblox supported Global functions :o

I'm gonna have some fun with this.

( ͡ಠ ͜ʖಠ)
Report Abuse
IdealDev is not online. IdealDev
Joined: 25 Mar 2010
Total Posts: 105
09 Oct 2014 10:24 AM
Thanks.
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