I'm trying to make a game like minecraft but my chunk loader is just a bit crazy.
Source Code:
--By enes223
local prefabStorage = game:GetService("ReplicatedStorage")
local Prefabs = {
["Grass"] = prefabStorage:WaitForChild("Grass")
}
local chunkX = 16
local chunkY = 64
local chunkZ = 16
local chunkSize = Vector3.new(chunkX,chunkY,chunkZ)
local chunkPosX = 0
local chunkPosY = 0
local chunkPosZ = 0
local chunkPos = Vector3.new(chunkPosX,chunkPosY,chunkPosZ)
local chunkNumber = 0
local Seed = math.random(0,10000000)/100
local noiseScale = 25
local Amplitude = 15
local blockNum = 0
local function createChunk()
local primarySelected = false
local chunkGroup = Instance.new("Model")
chunkGroup.Name = "Chunk"..chunkNumber
chunkGroup.Parent = game.Workspace.Terrain
for x = chunkPosX-1,chunkX do
for y = chunkPosY-1,chunkY do
for z = chunkPosZ-1,chunkZ do
local noiseX = math.noise(y/noiseScale,z/noiseScale,Seed) * Amplitude
local noiseY = math.noise(x/noiseScale,z/noiseScale,Seed) * Amplitude
local noiseZ = math.noise(x/noiseScale,y/noiseScale,Seed) * Amplitude
local Density = noiseX + noiseY + noiseZ + y
if Density < 10 then
local Block = Prefabs.Grass:Clone()
Block.Position = Vector3.new(x*Block.Size.X,y*Block.Size.Y,z*Block.Size.Z)
Block.Parent = chunkGroup
if not primarySelected then
chunkGroup.PrimaryPart = Block
primarySelected = true
end
end
end
end
blockNum = 0
end
chunkNumber = chunkNumber + 1
chunkPos = chunkPos + Vector3.new(1*chunkSize.X,0,1*chunkSize.Z)
chunkPosX = chunkPos.X
chunkPosY = chunkPos.Y
chunkPosZ = chunkPos.Z
end
createChunk()
createChunk()

4 comments
When you use the built in hyperlink format, you put the text you want to appear in the brackets [], then the url to link to in the parenthesis (). Your youtube link opens to _blank.
https://www.youtube.com/watch?v=UkaK9Qx17zY - World Generation by SpooksHD
look at my video, also that world generation is really random
I'm just giving ideas.