Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is this an efficient way to use module scripts in single script architecture?

Here is my main script:

spawn(function() -- part of the main script anyway
	
	for i,v in pairs(game.Workspace.Tycoons:GetChildren()) do
	
		if v:IsA("Model") then
	
			savedTycoonsTable[v.Name] = v:Clone()
			
			local runTycoonDoor = require(moduleScripts.RunTycoonDoor)
			
			runTycoonDoor(v)
	
		end
	end
	
	require(moduleScripts.BoxDroppingScript)
	require(moduleScripts.DataSavingLoop)
	
end)

Here is some of what is inside the module BoxDroppingScript:

spawn(function()
	
	while wait(loopWaitTime) do -- may want to change this wait time
	
		randomBoxSelectorAndCreator()
	
	end
	
end)

return true

I had to spawn the loop in order that the module would return true in both module scripts. Is that the best way to go about single script architecture or is there a better and more efficient way? Hope you guys can help. Thanks!

1 answer

It maybe, however I've heard that some people where having problems with that with Filter Enabling.

This discussion is preserved as it was. New answers, comments, and votes are closed.