Well here I am again. The thing i do for requiring works. Atleast for me. The problem is no one else can see anything on my screen.
This is the code i am using for including requiring in my lib:
if CLIENT then
require("lib/gui/GUILib_Main.txt")
table.insert(StarOS.LoadedFiles,"lib/gui/GUILib_Main.txt")
ClientModules = getScripts()
for i = 1, #ClientModules do
table.insert(StarOS.LoadedFiles,ClientModules[i])
require(ClientModules[i])
end
end
if SERVER then
ServerModules = getScripts()
for i = 1, #ServerModules do
table.insert(StarOS.LoadedFiles,ServerModules[i])
require(ServerModules[i])
end
--StarOS.LoadSettings()
end
StarOS.FilesLoaded = true
StarOS.BootStatus = "Loading Settings..."
StarOS.LoadSettings()
end
StarOS.Boot()
And then this is what I am using in my screen:
--@require lib/staros/StarOSLib_Main.txt
Does anyone has an idea why just i can see stuff?
Thank you in advance!
Is it possible that --@includedir ...modules/client isn't working like --@requirecl ... , the client might not have the modules to draw with hence nothing drawing
Hmm. Could work gonna try that out. Thank you.
But one problem: How do i requirecl a whole folder? Because i just can include one file with it if i am not mistaken?
You're again mis-understanding how getScripts() works.
-- This snippet loads all script files.
local Scripts = getScripts()
for FilePath, CompiledScript in pairs( Scripts ) do
-- If you want to only load those from a certain folder, check FilePath starts with the folder path.
-- Calling the CompiledScript function loads the script file.
CompiledScript()
end
I'll add this example to the in-game documentation too.