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!
