Some help with entities.

I am learning some lua and decided to make a car petrol mod type of thing,what I am wondering is how can I attach a tank to a car as soon as it is created and make two separate entities that once they are connected like connecting hose to a tank on a car or something it would then increase the ammount of petrol in the car.

(User was banned for this post ("Wrong section" - mahalis))