Find distance between two ents

I was wondering if there is a way to find the distance between to entities.

Say like if entity1 and entity2 are within each of 64 then?

I’m asking because I want to make mixture.

if ent_metal is close to ent_plastic then
boom prop pops up.

You could simply use the Collision hook.
[lua]
– This is in ent_metal
function ENT:Touch(activator)
if activator:GetClass() == ent_plastic then
– Boom! Prop pops up!
activator:Remove()
self.Entity:Remove()
end
end
[/lua]

I suggest using this because else we’ll have to hook some calculations to Think() for each prop there is and it might get laggy.

That works. I’m pretty this is answeres it thanks.

EDIT: ninja’d