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: _G Table Question

Previous Thread :: Next Thread 
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
21 Jun 2012 07:07 PM
Can functions be stored in the _G table? If so:
-------------------------------------------------------
Can they be carried across scripts?
Can they be used across games?
How do you create it?
Report Abuse
crazyman32 is online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
21 Jun 2012 07:09 PM
Can functions be stored in the _G table? If so: ** YES
-------------------------------------------------------
Can they be carried across scripts? ** YES (Only on the same client/server)
Can they be used across games? ** NO
How do you create it? ** BELOW


function _G.Test(msg)
print(msg:upper())
end


Other script:

_G.test("Hello there")

Output:
HELLO THERE
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
21 Jun 2012 07:10 PM
Another question:
Can the script that creates them be delted, or does it have to stay?
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
21 Jun 2012 07:11 PM
Meant to type "deleted."
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
21 Jun 2012 07:39 PM
As long as its attached to the table, it should stick without the script.
Report Abuse
zapzing303 is not online. zapzing303
Joined: 05 Mar 2010
Total Posts: 1486
21 Jun 2012 07:42 PM
Ok. Thanks. I might just save a backup to fix it if it breaks :D
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
21 Jun 2012 07:47 PM
Since _G is a globally defined table (accessible from all scripts running on same server or client), it is not removed or changed when a script is removed.

This means all values in _G remain in _G until CHANGED via script.
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