#How do I require My DataStore from my modulescripts

1 messages · Page 1 of 1 (latest)

prisma lichen
#

I might be overcomplicating it but when I see about requiring stuff from modules its always [modulename].function()

so how do I require stuff outside of it being a function and how many others ways is there to do this?
(since I don't fully understand modules yet)

hollow flax
#

do you need something specic that isn't a function

#

im trying to understand what you mean lol

prisma lichen
ebon jungleBOT
#

studio** You are now Level 2! **studio

prisma lichen
#

and i want to put said data into module scripts instead of main

#

but then i want to know how to specifically require that data into main script without it having to be a function of some sort

hollow flax
#

so you want to call info from the module script? basically lol

ebon jungleBOT
#

studio** You are now Level 24! **studio

hollow flax
#

i think you can store variables, but i'll let someone more informed answer since i started learning modules too

#

thoguh you might be trying to something like

local Module = {}

Module.myInfo = {
    [1] = "a",
    [2] = "b",
    [3] = "c"
}

return Module

from script:

-- require() blah blah
local value = Module.myInfo[3]
print(value)  -- will be 'c'