IsZoneEmptyWithIgnoreList

Constructor:

IsZoneEmptyWithIgnoreList(minPoint,maxPoint, ignoreTable)

Description

Returns a Bool, indicating whether there are part objects of the specified data type or in the specified zone.

Parameters

Name Type Description
minPoint Vector3 Minimum point that forms the enclosed area
maxPoint Vector3 Maximum point forms the enclosed area
ignoreTable table List of objects to ignore

Return Value

Type Description
bool Checks whether there is a part object in the area or not. true represents for no part

Examples

Continuously check whether there is a part in the zone from point(0,0,0) to point(5,5,5) or not.

local function MyUpdate()
    local minPoint = Vector3.New(0,0,0)
    local maxPoint = Vector3.New(5,5,5)
    local ignoreTable = {WorkSpace. NewBackground, WorkSpace. Spawn}

    local bool = WorkSpace:IsZoneEmptyWithIgnoreList(minPoint,maxPoint,ignoreTable)
    if bool then
        WorkSpace. Spawn.Color = Vector3.New(255,0,0) -- If no part is found, change the color of the spawn into red
    else
        WorkSpace. Spawn.Color = Vector3.New(0,255,0) -- If a part is found, change the color of the spawn into green
    end
end
    
local function coroutineUpdate()
    while true do
        coroutine.wait(0.1)
        MyUpdate()
    end
end

coroutine.start(coroutineUpdate)