WorldRoot:IsRegion3EmptyWithWhiteList

Currently there are white listing methods for FindPartsInRegion3 and FindPartOnRay, but not for IsRegion3Empty.

For consistency, IsRegion3EmptyWithWhiteList should be added since the other functions have whitelisting functions. (FindPartsInRegion3WithWhiteList, FindPartOnRayWithWhitelist)

The reasons for having a white list are so you don’t have to invert the white list into an ignore list.

3 Likes

I don’t think this is a good description of a “use case” – what are you actually trying to use it for? (i.e. in terms of game features)

1 Like

I would use it for checking if there was anything around a player. (other players, environmental hazards, etc.)

It could also be used for checking if all players have left a region, and then something would happen when all players had left.
Or the inverse, and checking if there are any players in a region and doing something when the first player enters a region.

1 Like
local isEmpty = #WorldRoot:FindPartsInRegion3WithWhiteList(region, whitelist) == 0

this works just fine right?

though just for consistency’s sake I’d say it would be nice to be added, since IsRegion3Empty is already added and that’s pretty much just #WorldRoot:FindPartsInRegion3(region) == 0

3 Likes

Yeah, that should work. Using maxParts might help though

local function IsRegion3EmptyWithWhiteList(WorldRoot,region,whitelist)
    return WorldRoot:FindPartsInRegion3WithWhiteList(region,whitelist,1)[1] == nil
end
2 Likes