Greetings developers!
I come to you with a quest. In all seriousness, I need help randomly generating parts.
my script:
local Pos1 = Vector3.new(0,-3,0)
local Size1 = Vector3.new(5,5,5)
local BasePart = Instance.new("Part")
BasePart.Anchored = true
BasePart.Parent = workspace
BasePart.Position = Pos1
BasePart.Size = Size1
local clone1 = BasePart:Clone()
clone1.Position = Pos1 + Vector3.new(4.999, 0, 0)
clone1.Parent = workspace
local clone2 = BasePart:Clone()
clone2.Position = Pos1 + Vector3.new(0, 0, 4.999)
clone2.Parent = workspace
local clone3 = BasePart:Clone()
clone3.Position = Pos1 + Vector3.new(-4.999, 0, 0)
clone3.Parent = workspace
local clone4 = BasePart:Clone()
clone4.Position = Pos1 + Vector3.new(0, 0, -4.999)
clone4.Parent = workspace
for i,v in pairs(workspace:GetChildren()) do
if v:IsA("Part") and v.Name == "Part" then
local x = v:Clone()
x.Position = x.Position * Vector3.new(2,1,2)
end
end
It generates the base part and the clones which serves as a base for the game. It doesn’t actually generate the parts at all. The problem is the for loop.
I really just want it to infinitely duplicate parts and fill out a huge area. Feel free to ask questions.
edit: there is a spawn location in the workspace located at 0, 0, 0. not sure if it’s relevant.
Thank you in advance!
Any help much Appreciated.
- vet