Is there any way to access elements of a script of a particular scene from another scene's script

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Anand
:warning: Old Version Published before Godot 3 was released.

Is there any way to access elements of a script of a particular scene from another scene’s script.

say I have a main scene of node2d type n it has a script called xx.gd
a node called xxx is a child of node2d (instancing)
now xxx has a script dd.gd
so how access elements (say get value of a current value of a random function )
which is in dd.gd from xx.gd

:bust_in_silhouette: Reply From: avencherus

If the variable in question is a member variable, meaning it’s outside the function code, this should put it in a scope that can be reached using get_node()

The code might look something like this (depending on your node setup and where the scripts are attached):

other_scripts_variable_value = get_node('xxx').desired_variable