|
| 20 Feb 2016 08:36 AM |
I have a script that has a table that has the storage of some stuff but the script is little bit confusing at times but i can read it and i just want to know how to insert it into a module script so i can require that instead?
Like so:
table.insert(x,t)
But i want x to be in a module, help anyone?
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:37 AM |
Like the table insert is from a server script
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:43 AM |
bump
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:46 AM |
make a function in the module that has something like this
--module script local module = {}
function module:InsertTable(Table) module.Table = Table end
return module
then in a server script:
local core = require ( game.ServerStorage.ModuleScript)-- change location to fit u
local Table = {1,2,3,4}-- for example
core:InsertTable(Table)
for k,v in pairs(core.Table) do print (k) end
try that
#Strikin' |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:47 AM |
alright ill try that
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:51 AM |
Wait, does it insert 1,2,3,4 from the server script into the module? Correct?
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:53 AM |
it inserts a table, with the values 1,2,3,4 in this case
#Strikin' |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:54 AM |
Alrighty, thanks, and i can insert something into that table in the server script and it will still be put into the module?
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 08:59 AM |
Like i need it so it does something like this:
Server script:
local core = require(script.ModuleScript)-- change location to fit u
local Table = {1,2,3,4,""}-- for example
core:InsertTable(Table)
table.insert(Table,"Gav")
for k,v in pairs(core.Table) do print(k) end
Module script:
local module = {} function module:InsertTable(Table) module.Table = Table end return module
But in the output it counts up to 6
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 09:35 AM |
no you would have to do:
table.insert(core.Table,value)
#Strikin' |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 09:57 AM |
got it, thanks
local strings = [[string.ClutchDeveloper() and string.GavAttack12()]] |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2016 10:11 AM |
| You can return mixed tables? |
|
|
| Report Abuse |
|
|