Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I randomize the type of building and spawn them in a line?

Asked by 10 years ago

I have it so it builds a basic house, I just want it so it spawns like 12 in a line but each one is different in color and size..But I want it randomly generated..Here's what I have so far:

brck = Instance.new("Part")
brck.Name = "One"
brck.Parent = game.Workspace
brck.Anchored = true
brck.Size = Vector3.new(30,20,25)
brck.BrickColor = BrickColor.new("Pastel brown")
brck.BottomSurface = "Smooth"
brck.TopSurface = "Smooth"

game.Workspace.BasePlate.Texture.Parent = game.Workspace.One
game.Workspace.BasePlate.Texture2.Parent = game.Workspace.One
game.Workspace.BasePlate.Texture3.Parent = game.Workspace.One
game.Workspace.BasePlate.Texture4.Parent = game.Workspace.One

roof = Instance.new("Part")
roof.Name = "Roof"
roof.Parent = game.Workspace
roof.Anchored = true
roof.Size = Vector3.new(35,2,30)
roof.Position = Vector3.new(0,20.5,0)
roof.BrickColor = BrickColor.new("Brown")
roof.TopSurface = "Smooth"
roof.BottomSurface = "Smooth"

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago

I can help you on the random part..

RandomBuildings = game.Lighting.Buildings:GetChildren() -- Going to have to change this to go to the buildings
Building = math.random(1,#RandomBuildings) -- What this should do is select 1 building randomly.
Ad

Answer this question