Advertisement
The_lua_dude

Roblox water remover

Jun 14th, 2018
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. --[Water remover]--
  2. --[By @_Ntoine31_]-
  3.  
  4. --Run this code in roblox studio command bar to remove any water of the terrain object--
  5. reg = Region3.new(Vector3.new(-512,-100,-512),Vector3.new(512,100,512))
  6. local Mat,Occ = game.Workspace.Terrain:ReadVoxels(reg,4)
  7.  
  8. for x,_ in ipairs(Mat)do
  9.     game:GetService("RunService").RenderStepped: wait()
  10.     print(Mat[x])
  11.     for y,_ in ipairs(Mat[x])do
  12.         for z,_ in ipairs(Mat[x][y])do
  13.             if Mat[x][y][z] == Enum.Material.Water then
  14.                 Mat[x][y][z] = Enum.Material.Air
  15.             end
  16.         end
  17.     end
  18. end
  19.  
  20. game.Workspace.Terrain:WriteVoxels(reg,4,Mat,Occ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement