I want people to configure the load asset to customize the looks from the model. But the script does not read the other content table from the "Settings Script"
The first script is named "Settings" And is a Module script.
local settings = {} --Lightings Configurations settings.SunFlare = true --Additional Custom Sunrays to the sun (Not Roblox Default Sunrays) return settings
And i have another script name "MainSettings_Operation" Is another module() script.
local settings = settings(getmetatable) if settings.SunFlare == true then script.Parent.Lensflare1:Clone().Parent = game.StarterGui end
SunFlare is set to "True" And i want the script to Clone the "Lensflare1" For the sun effects
However, the script does not give the gui and i Might have use a wrong code? Or I have a mistake in this system?
Module scripts are ascertained via the require() method. So, you would do require(PATH_TO_YOUR_SETTINGS_MODULE), then do settings.SunFlare == true if statement.
As long as you put the module name before the variable you should be able to access the settings. This is a very simple example:
Module
local setting = {} -- you could also put settings in the {} like a table setting.SettingHere = "Hello" return setting
Script
local setting= require(game.ReplicatedStorage.ModuleScript) print(setting.SettingHere) -- prints Hello
This also works in LocalScripts