Assign Rotation Value to a Property

Alright, this is kind of a takeoff on the thread “How to get actual object rotation.” I was gonna ask how to do that, but that thread answered it perfectly. Now, my next mission is this: Once the script figures out the rotation of the object, I want to take the y axis rotation and assign that value to a property. For example, say the object has the property “rotation.” If the object is rotated 45 degrees along the y axis, I want the value of the property “rotation” to be 45.

Also, just to make things more interesting, I want it to also affect the property on another object. So, using the same example, if there is an Object A and Object B, and both objects have a property called “rotation” if object A is roatated 45 degrees, then the value of “roation” on Object A AND Object B is 45. Is there any way to do this?