I Want to make this code generate islands like skyven, this is my current code but i need it to make floating islands
function Generation.GenerateIsland(X,Z,Grid)
for x = 1, X do
Grid[x] = {}
for z = 1, Z do
Grid[x][z] = math.noise(x/10,z/10) * 15
end
end
for x = 1, X do
for z = 1, Z do
local Y = Grid[x][z]
local Part = Instance.new("Part")
Part.Anchored = true
Part.Parent = workspace.Generated
Part.Size = Vector3.new(math.random(5,20),30,math.random(5,20))
Part.Material = Enum.Material.SmoothPlastic
Part.Position = Vector3.new(x+Part.Size.X * 5,Y,z+Part.Size.Z * 5)
Part.BrickColor = BrickColor.new("Medium stone grey")
Part.TopSurface = Enum.SurfaceType.Smooth
Part.BottomSurface = Enum.SurfaceType.Smooth
local Grass = Instance.new("Part")
Grass.Anchored = true
Grass.Position = Vector3.new(x+Part.Size.X* 5,(Part.Position.Y + Part.Size.Y) - 14.9,z+Part.Size.Z * 5)
Grass.Parent = workspace.Generated
Grass.Size = Vector3.new(Part.Size.X,0.2,Part.Size.Z)
Grass.Material = Enum.Material.SmoothPlastic
Grass.BrickColor = BrickColor.new("Forest green")
Grass.TopSurface = Enum.SurfaceType.Smooth
Grass.BottomSurface = Enum.SurfaceType.Smooth
end
end
end
return Generation```
I know this doesn’t quite answer your question, but it is an alternative. How about instead of literally creating an island in a script, you have pre made island pieces that can be randomly selected and positions to put together a unique island every time (or change it so it’s the same every time).
I hope this makes sense and give you another idea.
Sorry, I’m currently not on my pc but I’ll try to explain the best of my abilities. You can have a folder of multiple island pieces in server storage or replicated storage (idk if you want it server or client sided. From there you would clone the pieces and parent them to workspace (or probably a folder in workspace it keep it organized). About setting the position randomly, I’d recommended looking about the dev forum or documentation page, maybe even tutorials. Here’s a helpful link: