local script
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local Module = require(ReplicatedStorage.Module)
local Info = require(ReplicatedStorage.Module.Info)
local Grid = script.Parent
Module.Create(Grid, Info.Stage1)
main module
local Module = {}
function Module.Create(Grid, Info)
local BlockTemplate = script.Block
local PathTemplate = script.Path
local TeleporterTemplate = script.Teleporter
(logic here)
end
return Module
info module
local Info = {
Stage1 = {
Blocks = {5},
Paths = {1, 2, 3, 4, 6, 7, 8},
Teleporters = {9}
}
}
desired behavior in the main module: goes through the info of stage1 in numerical order and clones its respective template and parents it to the grid, name it its respective number for example, it would clone paths 1-4 using the path template and then it would clone a teleporter (5) and repeat until 9