FindPartsInZoneWithIgnoreList

Constructor:

FindPartsInZoneWithIgnoreList(minPoint,maxPoint,ignoreTable,maxParts)

Description

Returns an array, the contents of which are all part objects in the specified zone, ignoring the objects in the table.

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 ignored objects
maxParts int Maximum number of parts

Return Value

Type Description
table List of found objects

Examples

Continuously seek all parts in the zone from point(0,0,0) to point(10,10,10), ignoring the background and the pawn location, and output the names of found parts.

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

    local list = WorkSpace:FindPartsInZoneWithIgnoreList(minPoint,maxPoint,ignoreTable,maxParts)
    for k,v in pairs(list) do
        printf(v.Name)
        v.Color = Vector3.New(255,0,0)
    end
end
    
local function coroutineUpdate()
    while true do
        coroutine.wait(0.1)
        MyUpdate()
    end
end

coroutine.start(coroutineUpdate)