clear block||doc135399

September 20, 2022

Format

 Map:clearBlocks(min, max, all) 
  • The class to which the function belongs:Map

Description

Clears all blocks in an area consisting of min and max coordinates.


Precautions

  • The min coordinate must be less than the max coordinate, otherwise the block cannot be filled.
  • The values for each axis of the min and max coordinates must be integers, otherwise unintended consequences will occur.
  • If the all parameter is not true, only the blocks that need to be saved in the area will be cleared

Parameters

Variable name type Description
min Vector3 Minimum coordinates
max Vector3 maximum coordinate
all boolea Whether to clear all


Code Samples

on the server sideglobal script, clears all blocks in the area

local map = World.CurWorld:getMap("map001")
map:clearBlocks({x = 0, y = 0, z = 0}, {x = 2, y = 2, z = 2}, true)