*What do you want to achieve?
So far I’ve learned to copy and paste regions for my game that uses them for certain maps. My lobby currently has Terrain in it and would be affected heavily if I just used Terrain:Clear() for whenever I wanted to change maps.
What solutions have you tried so far?
So far I’ve tried setting the current region of the map to air using FillTerrain:() but that doesn’t work since it doesn’t work with Region3int16. It only takes Region3 for some reason.
Here’s the script that errors with Region3int16. If I switch it all to Region3, you can’t use :CopyRegion() and if I switch it all to Region3 you can’t use FillRegion().
local post0, post1 = game.Workspace.post0, game.Workspace.post1
local point0 = post0.Position + Vector3.new(0, post0.Size.Y/2, 0)
local point1 = post1.Position - Vector3.new(0, post1.Size.Y/2, 0)
local r = 4
local minX = math.min(point0.X, point1.X)
local maxX = math.max(point0.X, point1.X)
local minY = math.min(point0.Y, point1.Y)
local maxY = math.max(point0.Y, point1.Y)
local minZ = math.min(point0.Z, point1.Z)
local maxZ = math.max(point0.Z, point1.Z)
local corner = Instance.new("Part")
corner.Anchored = true
corner.Size = Vector3.new(1.2, 1.2, 1.2)
corner.Position = Vector3.new(minX, minY, minZ)
corner.Color = Color3.fromRGB(0,255,0)
local corner2 = corner:Clone()
corner2.Position = Vector3.new(maxX, maxY, maxZ)
corner.Parent = game.Workspace
corner2.Parent = game.Workspace
local region = Region3int16.new(Vector3int16.new(minX/r, minY/r, minZ/r), Vector3int16.new(maxX/r, maxY/r, maxZ/r))
print("Point0", point0)
print("Point1", point1)
print("Region", region)
local terrain = game.Workspace.Terrain:CopyRegion(region)
wait(10)
local SmoothTerrainAirCode = 1792;
local Resolution = 1;
workspace.Terrain:FillRegion(region, Resolution, SmoothTerrainAirCode);