Advertisement
hevohevo

ComputerCraft Tutorial: CommandComputerTest

Feb 21st, 2015
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. -- CommandComputerの位置をゲット
  2. local cx,cy,cz = commands.getBlockPosition()
  3.  
  4. function buildFrame(x,y,z,block_name)
  5.   for i=-1,1 do
  6.     commands.setBlock(x+i,y,z+1,block_name)
  7.   end
  8.   for i=-1,1 do
  9.     commands.setBlock(x+i,y,z-1,block_name)
  10.   end
  11.   for i=-1,1,2 do
  12.     commands.setBlock(x+i,y,z,block_name)
  13.   end
  14. end
  15.  
  16. -- ######################################
  17. -- メイン
  18.  
  19. -- 施設建設
  20. buildFrame(cx,cy+1,cz, "minecraft:iron_bars")
  21. commands.setBlock(cx,cy+1,cz,"minecraft:flowing_lava")
  22.  
  23. -- 村人さんかわいそす
  24. while true do
  25.   commands.playsound("mob.endermen.portal","@a")
  26.   commands.summon("Villager", cx,cy+4,cz)
  27.   os.sleep(3)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement