// 4-in-a-Row Rotating planes object v001.002 // During idle time, rotates automatically every minute // During play, rotates when current player touches a plane list rotations = [ // HORIZ/VERT/PLANAR < 0.0, 0.0, 0.0 >, < 90.0, 0.0, 0.0 >, < 0.0, 90.0, 0.0 > // TIPPED ON POINT //< 45.0, 45.0, 0.0 > //< 135.0, 45.0, 0.0 > //< 45.0, 135.0, 0.0 > ]; integer rotIndex = 0; integer TalkOn = -4444; key Who; Planes_Rotate () { rotation newRot = llEuler2Rot ( llList2Vector ( rotations, rotIndex ) * DEG_TO_RAD ); llSetRot( newRot ); rotIndex = ( rotIndex + 1 ) % 3; } default { state_entry() { llSetTimerEvent( 60.0 ); llListen( TalkOn, "4-in-a-Row", NULL_KEY, "" ); } timer() { Planes_Rotate(); } listen(integer channel, string name, key id, string message) { Who = (key) message; if( Who != NULL_KEY ) { llSetTimerEvent( 0.0 ); rotIndex = 0; Planes_Rotate(); } else { llSetTimerEvent( 60.0 ); } } touch_start( integer AnyTouch ) { if( Who != NULL_KEY ) { integer count = 0; for(; count < AnyTouch; ++count ) { key whoTouched = llDetectedKey( count ); if( whoTouched == Who ) Planes_Rotate(); } } } }