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

Generating Problem [closed]

Asked by 11 years ago

I got an answer from my question on 'Generation' about generating blocks. But is there anyway to fix this? OR understand some of it so ** I ** can fix it? It doesn't connect and stuff you can try it:

01local block = script.Parent.Grass
02local function GetBlock()
03    return block:Clone()
04end
05local function GetSize()
06    return block.Size.z
07end
08-- Assing random position ranges
09local x_min, x_max = -100,100
10local z_min, z_max = -100, 100
11local y_min, y_max = 1,10 -- this is in block units.
12for x = x_min, x_max, GetSize() do
13    for z = z_min, z_max, GetSize() do
14        local height = math.random(y_min, y_max)
15        for y = GetSize()/2, GetSize() * (height + 0.5), GetSize() do
View all 22 lines...

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 11 years ago
Edited by JesseSong 4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).
1local block = GetBlock()
2block.CFrame = CFrame.new(x,y,z)
3block.Parent = game.Workspace

That will not work because it returns a number. You cannot change a number's CFrame/Parent.

Ad
Log in to vote
-1
Answered by 11 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

what exactly is the problem ?

0
Include a valid description. Simply saying "What exactly is the problem" is not a valid answer, and should be written as a comment INSTEAD of an answer. JesseSong 3916 — 4y