It depends on how the connection is made, but one example would be:
onready var accesNode = get_node("/root/.. ..../NodeTheScriptIsIn")
var Myvar = accesNode.var
Where you load the node using the get_node method. To which the script is attached.
And then you can use the accesNode.(youdefinedvar) to acces it.