So i'm trying to make a world that generates itself randomly in a grid in a radius around the player but i have no idea how to and methods of doing something like this?
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) while wait(5) do for i,Chunk in pairs (game.Workspace.Folder:GetDescendants()) do if Chunk.Name == "Base" and Chunk:IsA("Part") and (Vector3.new(char.HumanoidRootPart.Position.X,49,char.HumanoidRootPart.Position.X) - Chunk.Position).Magnitude <= 120 then for i,subchunk in pairs(game.Workspace.Folder:GetDescendants()) do if subchunk.Name == "Base" and subchunk:IsA("Part") then if (Chunk.CFrame * CFrame.new(64,0,0)).X == subchunk.CFrame.X then else local model = game.ReplicatedStorage.TestChunkSize1:Clone() model.Parent=workspace.Folder model:SetPrimaryPartCFrame(Chunk.CFrame * CFrame.new(64,0,0)) end end end end end end end) end)