diff --git a/src/Zone/init.lua b/src/Zone/init.lua index 62de930..eea05f7 100644 --- a/src/Zone/init.lua +++ b/src/Zone/init.lua @@ -789,16 +789,32 @@ function Zone:unbindFromGroup() end end -function Zone:relocate() +function Zone:relocate(newParent: Instance?) if self.hasRelocated then return end + if newParent then + self.worldModel = newParent + self.hasRelocated = true + + local relocationContainer = self.container + if typeof(relocationContainer) == "table" then + relocationContainer = Instance.new("Folder") + for _, zonePart in pairs(self.zoneParts) do + zonePart.Parent = relocationContainer + end + relocationContainer.Parent = newParent + end + + return + end + local CollectiveWorldModel = require(collectiveWorldModelModule) local worldModel = CollectiveWorldModel.setupWorldModel(self) self.worldModel = worldModel self.hasRelocated = true - + local relocationContainer = self.container if typeof(relocationContainer) == "table" then relocationContainer = Instance.new("Folder")