Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rotation Script Needed...

Savannah Christensen
playing EQ instead
Join date: 4 Jan 2006
Posts: 64
06-24-2007 21:39
Ok, first of all I have a few rotation scripts already but I would like to improve my ceiling fans so that they can be turned on and off just by clicking.

Even better would be the ability to have 3 settings (off, slow, and fast)

I've searched through these forums so many times, and if I knew anything at all about scripting Im sure it wouldnt be hard to figure out how to modify the scripts Im already using... but Im as clueless as they come.



If anyone can help, please let me know.

Thank you,
Savannah
Dytska Vieria
+/- .00004™
Join date: 13 Dec 2006
Posts: 768
06-25-2007 00:16
Here it is for you, simply click on part that rotates:

integer on;
integer curspeed = 0;

default
{
state_entry()
{
llTargetOmega ( <0, 0, 1>, curspeed * 0.1 * PI, 1.0 );
}
touch_start(integer total_number)
{
curspeed+=2;
if (curspeed == 8)
{
curspeed = 0;
}
llTargetOmega ( <0, 0, 1>, curspeed * 0.1 * PI, 1.0 );
}
}
_____________________
+/- 0.00004
Savannah Christensen
playing EQ instead
Join date: 4 Jan 2006
Posts: 64
06-25-2007 01:57
Thank you SO very much Dytska

I really appreciate it!!