Terrain material replacement command doesn't work

Not sure if this is the right place to post this,but…

workspace.Terrain:ReplaceMaterial(Region3.new(Vector3.new(5000,5000,5000),Vector3.new(5000,5000,5000));,“LeafyGrass”,“Snow”)

is there anything wrong with this line?

2 Likes

This is the wrong category as you are seeking help for the code, move this to #help-and-feedback:scripting-support

Also, as you have mentioned, the code does not work. Please read: About the Code Review category

2 Likes

Why is there a semicolon? Try

workspace.Terrain:ReplaceMaterial(Region3.new(Vector3.new(5000,5000,5000),Vector3.new(5000,5000,5000)), Enum.Material.LeafyGrass, Enum.Material.Snow)
3 Likes

Region3’s are constructed by giving two opposite corner arguments. For instance, if you want to create a 2 cubic stud region relative to world 0,0,0 , you would say: Region3.new(Vector3.new(0,0,0),Vector3.new(2,2,2)).

Screen Shot 2020-01-08 at 2.41.42 PM

You are giving the same positional argument both times, creating a region of 0 cubic studs.

5 Likes

so,for a 5000x5000x5000 map it would be Region3.new(Vector3.new(-2500,-2500,-2500),Vector3.new(2500,2500,2500)). ?

2 Likes

still,nothing happens :confused:

1 Like

Try: workspace.Terrain:ReplaceMaterial(Region3.new(Vector3.new(-2500,-2500,-2500),Vector3.new(2500,2500,2500)),4,Enum.Material.X, Enum.Material.Y)

X is the material you want to change, Y is the material you want to change to.

2 Likes