How to declare an object X rotation -_-

Okay So I have a sun and I had a script on it for when it rose at a certain time the intensity would change. However the skybox transition was way off so I want to simplify it so that I can just call an IF statement that states when the sun is at a certain rotation have the intensity change.

I want the sun’s position to affect the intensity. so…

sun x.position = 270 intensity = 0 sun x.position = 235 - 0 intensity = .5

Anyone want to help me with this? Thanks!

If someone closed the question, it was probably for a reason also, what’s with your code? I mean, it just doesn’t make sense. I mean, it just…ugh cringes oka- cringes again ugh. Here is the code BE AWARE THAT I AM NOT SUPPOSED TO ANSWER THIS AND I SHOULD CLOSE IT BECAUSE IT IS A “Write my code” question, which is not aloud, i am helping you because you obviously have no experience coding…at all, but alas, I shall write your code;

var intensity : float; //this is the intensity of your light
var sun : Light; //assign the sun object here (i am assuming that you are using a light component)

function Update()
//now, i have no idea what you're trying to accomplish here so i am going to take a guess

if (sun.transform.rotation.x <= 270)
sun.intensity = 0;
if (sun.transform.rotation >= 235)
sun.intensity = 0.5;