I wanted to draw a cube with 4x1x4 plates but this happen.
How i do fix it?
local x = 0
local z = 0
for i = 1, 100 do
task.wait()
local plateclone = script.Parent:Clone()
plateclone.Script:Destroy()
x += 4
if x >= 40 then
x = 0
z += 0
z += 4
end
plateclone.Position = Vector3.new(x, 0, z)
plateclone.Parent = workspace
end
make the loop loop 99 times instead of 100 i just tested that
local x = 0
local z = 0
for i = 1, 99 do
task.wait()
local plateclone = script.Parent:Clone()
plateclone.Script:Destroy()
x += 4
if x >= 40 then
x = 0
z += 0
z += 4
end
plateclone.Position = Vector3.new(x, 0, z)
plateclone.Parent = workspace
end
Figured it out. Set your x variable to -4 at the start, and keep the for loop at i = 1,100, or just move the x += 4 line after the position is set
local x = -4
local z = 0
for i = 1, 100 do
task.wait()
local plateclone = script.Parent:Clone()
plateclone.Script:Destroy()
x += 4
if x >= 40 then
x = 0
z += 0
z += 4
end
plateclone.Position = Vector3.new(x, 0, z)
plateclone.Parent = workspace
end