--- ModuleScript
local object_prototype = {}
--- Object Constructor
function object_prototype:new(msg: string?)
local obj = {message = msg or ""}
setmetatable(obj, self)
self.__index = self
return obj
end
function object_prototype:method()
print(self.message)
end
return object_prototype
--- Script
local object = require(the_module_script)
local object_instance = object.new("hi!")
object_instance:method()
I hope I’m not late.
I’m not sure but you can try to return a table of fuctions like:
-- Module script
local module = {}
function module:Create()
-- ur things
local module2 = {}
function module:Unlock()
-- script
end
return module2
end
return module
--server
local module = require(--[[module path]])
local object = module:Create()
object:Unlock()
My idea was like to create module inside module
I hope you understood what i mean.
I don’t know what OOP is but it actually can be. Thank you for your help
This is a good idea for what i need. I can return the second functions after using the first one. Thank you for your help too.
You’re not late.
Same as Ziffix said, i can return the second functions of a table. Thank you for your help too.
Did I make a mistake while explaining, or did you misunderstand? I just asked how to use other functions inside a function. My English is probably not good enough to explain properly. I’m sorry.
In profile service i can use other functions after using the GetProfileStore function. I need to know how to make this in module scripts.
I used profile service to show this. After getting the Profile Store, I can use other function like LoadProfileAsync(). That’s what i need but i don’t know how i could do this.
Thank you everyone who helped me. Have a good day.