[LUA] Quick question about FindInSphere

Hello, I am creating a gas that spreads and I am trying to make it so it searches near every player if there’s one of those gas entities.
Only problem is I want to FindInSphere but it returns entities that aren’t the gas, and to filter them out I would have to make a loop, which is bad because I already have the function in a loop.
I was wondering if I could have a FindInSphere “stacking” with a FindByClass so it finds only the specified class in the specifies sphere.

You’d use “if condition then continue end” in the

ents.FindInSphere loop.


if (entity:GetClass() ~= "gas") then continue end

If you put this at the top of the loop then anything that isn’t the gas will, simply put, just be skipped.

WOW I DIDN’T EVEN KNOW SOMETHING LIKE THAT EXISTED

I wish there was reputation so I could give it to you