Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my smooth terrain generator not work?

I was eager to find a smooth terrain generator, so i went here and searched smooth terrain. I found this guy's script that had problems with holes, but i took it anyway. I added a few stuff to it, but now it doesn't work. Here's my script:

function smoothTerrain()
    --'loaded' is just a Model filled with all the correctly colored and sized Parts.
    for i, part in ipairs(loaded:GetChildren()) do
        if part.BrickColor == BrickColor.Blue() then
            workspace.Terrain:FillBlock(part.CFrame, part.Size, "Water")
        elseif part.BrickColor == BrickColor.Green() then
            local shape = math.random(1, 2)
            if shape == 1 then
                workspace.Terrain:FillBlock(part.CFrame, part.Size, "Grass")
            else
                workspace.Terrain:FillBall(part.Position, part.Size.Y/2, "Grass")
            end                        -- editing begins here
        elseif part.BrickColor == BrickColor.Yellow() then
	
            workspace.Terrain:FillBlock(part.CFrame, part.Size, "Sand")
elseif part.BrickColor == BrickColor.Red then
		workspace.Terrain:FillBlock(part.CFrame, part.Size, "CrackedLava")
elseif part.BrickColor == BrickColor.new("Medium Stone Grey") then
	workspace.Terrain:FillBlock(part.CFrame, part.Size, "Slate")
elseif part.BrickColor == BrickColor.new("Dark Stone Grey") then
	workspace.Terrain:FillBlock(part.CFrame, part.Size, "Rock")
        end
    end
end

Does anyone know what i am doing wrong? Thanks so much. Troy

1 comment

0

Hey, this looks like Redbullusa's script.

1 answer

Well You Never Specified what loaded is in game so try adding this,

local loaded = workspace.loaded

Thats the only thing i can see, if you still have problems please leave a comment. hope this helps

7 comments

0

Thanks! I'll make that edit.

0

No problem, if you have anyother issues let me know

0

Wait, the guy i got the script from didn't specify loaded either, and i didn't put a part in workspace called loaded.

0

Then that line of code is un neccicary,

0

Oh, i put loaded and put all my terrain bricks in there, but it still won't work.

0

It may just be a problem with roblox then...

0

Change your elseifs to if, that might be a issue aswell

This discussion is preserved as it was. New answers, comments, and votes are closed.