When I try too require the module that I’m currently in, it gives me a recursive error
Anyway around this?
Heres an example of what I mean
When I try too require the module that I’m currently in, it gives me a recursive error
Anyway around this?
Heres an example of what I mean
Why would you need to require the module to get it again? You already have the table of the functions in your module so why would you need to require the module again?
Because I cant actually acess the module from within the table I’m working in which is inside of the module script
Just declare a ‘global’ table for the module.
local module = {} --Store the module's contents inside this table.
Wouldnt global mean that it doesnt have local in front or are you talking about _G?
module={}
local x=1
function module.doThis()
print("from do this function")
end
--access x using the variable name itself like
print(x)
--access dothis function by
module.doThis()
local myTable={"cat"}
--access this table using its name
print(myTable[1])
--if its like
local module.myTable={"cat"}
--access using
print(module.myTable[1])
--if its inside
local module={
name=1
}
--then access using
print(module.name)
return module
Oh lets go this worked thanks man!