On ENT:Touch it runs multiple times



AustinH spawned sent "crate"
Crate loaded
-2 left!
Crate loaded
-3 left!


That was from 1 crate being touched to a car. Not 2. However it prints that 2 were removed in console.

Here is the backend code…



function loadcrate()
	cratestoload = cratestoload -1 
	print("Crate loaded")
	print(cratestoload.." left!")
end


And here is the entity code…



function ENT:Touch(ent)
	if ent.IsVehicle() then
		self:EmitSound( "items/ammocrate_close.wav", 75, 100, 1, CHAN_AUTO )
		self:Remove()
		loadcrate()
	end
end


-snip-

Use StartTouch or EndTouch instead of Touch.

Works perfectly. Thanks