When clicked on, destroy other object's script?

Hi.

Here’s what I want to do:

By clicking on object -A-, destroy a specific script attached to object -B-!

I tried many ways to solve it but I couldn’t since I’m not quite good when it comes to scripting. Any help please?

A should have some kind of reference to B, or have a reference to something that has a reference to B or is a parent of B.

Then you can use sendMessage to B or to the parent of B that should know what to do when it receives that message, in which case, kill a child of it that is B.

just send a destroy or enable in a if statement. so if i click on this then destroy(gameObject.Find(“other”)).getcomponent(component))