快速建模地图围墙

快速建模围墙

d0d73321171c46cc921086edf7256a9a.jpg

 --快速生成围墙地形
--韩永旗制作
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)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值