Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do i manipulate terrain with a script (take away or add terain at certain positions)?

Asked by
esepek 103
3 years ago
Edited 3 years ago

So i was wondering if it is possible to manipulate terrain via script i hope you can help me out! Thank you :D.

1 answer

Log in to vote
0
Answered by 3 years ago

I am so glad you asked this! It is 100% possible to manipulate terrain via a script.

Check out this roblox created tutorial on how to do it: https://developer.roblox.com/en-us/articles/Scripting-With-Terrain

If you're curious on all the things you have to work with in the Terrain service, check this out: https://developer.roblox.com/en-us/api-reference/class/Terrain

If you want to do something such as add terrain in an area, try this

game.Workspace.Terrain:FillBlock(CFrame.new(4, 0, 4), Vector3.new(1, 1, 1), Enum.Material.Water)

The first argument is the position of where you are working. The 2nd argument is the size, and the final argument is the material.

To remove terrain, use the exact same thing, but set the material to air using Enum.Material.Air

Ad

Answer this question