- 0
Automatic night/day on/off lighting?
You are about to reply to a thread that has been inactive for 5256 days.
Please take a moment to consider if this thread is worth bumping.
Please take a moment to consider if this thread is worth bumping.
Question
CarneyInc Mint
So I've been attempting to produce a script that will cause objects to light up when it is night, and turn off when it is day. I figure it would be an easy matter to modify the given script on the SL Wiki to do this:
However, it has been causing me some trouble. I have some basic object-oriented program experience, but not very much, and am currently struggling to correctly modify this script. As of right now, what I am trying to make work is below, where I am simply attempting to make sure it can differentiate between night and day, but I can't even get it to compile correctly.
integer lightsOn = -1;
default
{
touch_start(integer total_number)
{
vector sun = llGetSunDirection();
integer turnLightsOn = (integer)(sun.z < 0);
if(turnLightsOn != lightsOn)
{
lightsOn = turnLightsOn;
llSay(0,turnLightsOn);
llSetPrimitiveParams();
}
}
}
Please advise! either on making the script I am attempting work, or even if someone knows of a/how to do the script I am looking for!! Thanks!!
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now