How to apply script saved in variable

Hi to all.
I want to add a component saved to a variable from “heal heart” to a character, who will collide with it.
I dont want to use
col.gameObject.AddComponent ();
Because there will be several different effects, and I want only to change effect.
I tried something like
col.gameObject.AddComponent ();
col.gameObject.AddComponent(typeof(testHeal));
This is all wrong.

If there is other, more correct way, tell me pleae, thank you!

If I understand correctly, you want to move a component from a GameObject to another. This can’t be done, you would have to add a new component and copy the values.

There is probably an easier way to achieve what you’re attempting to do.