What is this amber substance on the wood in my attic?
"it's sap crystals that have been extruded from the wood due to high attic temperatures. We see more of this sap staining when the wood used for framing was not kiln dried before construction." Inspectapedia

Sap in painted wood will cause staining but it is ok in the attic.