快速建模围墙
--快速生成围墙地形
--韩永旗制作
local g,h=90,90 --大小
local x0,y0,z0=0,7,0 --中心点坐标
local s=3 --颜色区块
function add(g,h)
local function destroyblock(x,y,z) Block:destroyBlock(x,y,z,false) end
local function setblock(x,y,z,id) Block:setBlockAll(x,y,z,id,0) end
local count=0
repeat
local x,y,z=x0+(count/g)-math.floor(g/2),y0,z0+math.floor(count%h)-math.floor(h/2)
for i=-1,2 do destroyblock(x,y+i,z) end
if math.floor(count%h)==0 or math.floor(count%h)==h-1 or math.floor(count/g)==0 or math.floor(count/g)==g-1 then
setblock(x,y-1,z,15)
setblock(x,y,z,500)
setblock(x,y+1,z,15)
setblock(x,y+2,z,500)
else
setblock(x,y-1,z,(math.floor((math.floor(math.floor(count%h)/s))+math.floor(math.floor(count/g)/s))%2+674))
end
count=count+1
threadpool:wait(0.01)
until count==g*h
end
add(g+2,h+2)