Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RunService = game:GetService("RunService")
- local cube = game.ReplicatedStorage.Cube
- local count = 10
- local scale = 3
- local seed = math.randomseed(tick())
- local cubes = {}
- for x = 1, count do
- for y = 1, count do
- for z = 1, count do
- local xNoise = math.noise(y/scale, z/scale, seed)
- local yNoise = math.noise(x/scale, z/scale, seed)
- local zNoise = math.noise(x/scale, y/scale, seed)
- local density = (1 + xNoise + yNoise + zNoise)/2
- local part = cube:Clone()
- part.Position = Vector3.new(x, y, z) * 5 -- 5 is the part size, this is so there isn't overlap
- part.Parent = workspace
- table.insert(cubes, {
- part = part,
- density = density
- })
- end
- end
- end
- wait(2)
- local threshold = 2
- while true do
- for _, cube in ipairs(cubes) do
- if cube.density < threshold then
- cube.part.Transparency = 0
- else
- cube.part.Transparency = 1
- end
- end
- threshold = threshold - .01
- RunService.Heartbeat:Wait()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement