Advertisement
gnidmoo

test_geolyzer.lua

Jun 7th, 2021
703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. local component = require("component")
  2.  
  3. local geolyzer = component.geolyzer
  4.  
  5. local offsetx = -10
  6. local offsetz = -10
  7. local offsety = -10
  8.  
  9. local sizex = 20
  10. local sizez = 20
  11. local sizey = 20
  12.  
  13. local map = {}
  14. local i = 1
  15. for y = 0, sizey - 1 do
  16. for z = 0, sizez - 1 do
  17. local scanData = geolyzer.scan(offsetx + x, offsetz + x, offsety + y, sizex, 1, 1)
  18. local j = 1
  19.  
  20. for x = 0, sizex - 1 do
  21. map[i] = {posx = offsetx + x, posy = offsety + y, posz = offsetz + z, hardness = scanData[j]}
  22. i = i + 1
  23. j = j + 1
  24. end
  25. end
  26. end
  27.  
  28. local hologram = component.hologram
  29.  
  30. for i = 1, sizex*sizez*sizey do
  31. hologram.set(map[i].posx, map[i].posy, map[i].posz, map[i].hardness > 0)
  32. end
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement