|
| 29 May 2015 04:40 PM |
I know terrain:Clear() but..
Also how do you get the terrain type?
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 04:54 PM |
b
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:20 PM |
You get a "block" or now a cell of terrain by using
Terrain:WorldToCellPreferSolid(Vector3) or Terrain:WorldTOCellPreferEmpty(Vector3)
This returns a vector3 value of where the closest cell is located to that position. Then to get the terrain type of that cell, you do Terrain:GetCell(int x, int y, int z)
I haven't figured out how to get the other things that it returns, but I figured this out: local Cell = Terrain:GetCell(x,y,z) print(Cell) --> Prints the Enum value of the material(Enum.Material.Grass, ect) |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:20 PM |
All of that is here http://wiki.roblox.com/index.php?title=API:Class/Terrain |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:21 PM |
Also:
http://wiki.roblox.com/index.php?title=API:Class/TerrainRegion |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:24 PM |
Can you say local block = blah
block:Destroy()
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:26 PM |
| I think you can just do :SetCell and set the cell type to nil. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:30 PM |
no worky
script.Parent.Equipped:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" Mouse.Button1Down:connect(function() game:GetService("Terrain"):WorldToCellPreferSolid(Mouse.Hit.p):SetCell(nil) end) end)
script.Parent.Unequipped:connect(function(Mouse) Mouse.Icon = "" end)
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:31 PM |
That is :SetCell(x,y,z, Enum.Material.Empty, Enum.CellBlock.Solid, Enum.CellOrientation.X)
or :SetCells(Region3int16, Enum.Material.Empty, Enum.CellBlock.Solid, Enum.CellOrientation.X)
CellBlock and CellOrientation can be anything that fits your needs. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:34 PM |
Wont work
script.Parent.Equipped:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" Mouse.Button1Down:connect(function() game:GetService("Terrain"):SetCell(Mouse.Hit.p,Enum.Material.Empty,Enum.CellBlock.Solid,Enum.CellOrientation.X) end) end)
script.Parent.Unequipped:connect(function(Mouse) Mouse.Icon = "" end)
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:44 PM |
script.Parent.Equipped:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" Mouse.Button1Down:connect(function() game:GetService("Terrain"):WorldToCellPreferSolid(Mouse.Hit.p):SetCell(Mouse.Hit.p,Enum.Material.Empty,Enum.CellBlock.Solid,Enum.CellOrientation.X) end) end)
script.Parent.Unequipped:connect(function(Mouse) Mouse.Icon = "" end)
"You don't want to be their cool. Be a good person by a respectable figures point; you." ~ TheNewChicken. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 06:01 PM |
local Terrain = game.Workspace:WaitForChild("Terrain")
script.Parent.Equipped:connect(function(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() local Cell = Terrain:WorldToCellPreferSolid(Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)) Terrain:SetCell(Cell.x, Cell.y, Cell.z, Enum.CellMaterial.Empty ,Enum.CellBlock.Solid,Enum.CellOrientation.X) end) end)
script.Parent.Unequipped:connect(function(Mouse) Mouse.Icon = "" end)
|
|
|
| Report Abuse |
|
|