| |
|
| |
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
| |
|
|
| 27 Jul 2014 11:47 AM |
| Yes, you could use _G. also. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 27 Jul 2014 12:21 PM |
| Module scripts are so much better |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 1059 |
|
| |
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
| |
|