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: are you allowed to access tables from other scripts?

Previous Thread :: Next Thread 
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
27 Jul 2014 11:44 AM
title
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 11:44 AM
yes
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
27 Jul 2014 11:45 AM
Yes.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
27 Jul 2014 11:47 AM
Yes, you could use _G. also.
Report Abuse
ModDeathRally9 is not online. ModDeathRally9
Joined: 02 Sep 2012
Total Posts: 370
27 Jul 2014 12:02 PM
SCRIPT 1:
_G.variablename = {"Table stuff", "more table stuff"}


SCRIPT 2:
print(_G.variablename)


-Should work, don't know exact syntax, but something like that. Look on wiki for Global Variables If you have trouble.
Report Abuse
WishNite is not online. WishNite
Joined: 11 Feb 2009
Total Posts: 15828
27 Jul 2014 12:21 PM
Module scripts are so much better
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:25 PM
.lua files are so much better.

Poop.lua
-----------------------------
module("Poop", package.seeall)

meta = {
__index = {
release = function(self)
print("I released "..self.kg.." kilograms of poop in your toilet.")
end;
}
}

function new(kg)
return setmetatable({kilograms = kg}, meta)
end
------------------------------
main.lua
------------------------------
require "Poop"

local myPoop = Poop.new(32)
myPoop.release()
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:30 PM
I messed up but whatever.
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
27 Jul 2014 05:02 PM
myPoop.release() XD.
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