Scripts are just files sitting in the project folder. They don't do anything on their own. They either define custom objects or are attached to nodes. The latter is far more common, so what you really have is node A and node B.
Nodes live in the scene tree. To communicate between nodes, you either use signals or get_node()
. To be more specific, you'd need to describe your actual setup.