Jump to content

Script for rotation prim (owner only)


Zarhym
 Share

You are about to reply to a thread that has been inactive for 3485 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello everyone;
I created a script for the rotation of a prim, I want the prim does not rotate when touched by other residents, I want to work only with the owner.


This is my script:

integer on  = FALSE;
default
{
    state_entry()
    {
        //llSay(0, "Hello, Avatar!");
    }

    touch_start(integer total_number)
    {
       if (on == FALSE) 
    {     
       llShout (0, "device on" );
       llTargetOmega(<0,0,2>, TWO_PI, 1);
       on = TRUE;
       
    }
     else if (on == TRUE)
    { 
      llShout (0, "device off");
      llTargetOmega(<0,0,1>, TWO_PI, 0);
      on = FALSE;
    }   
} 

} 

 Ty.

Link to comment
Share on other sites

You don't need the

else if (on == TRUE)

just 'else' will do,

I changed the shouts to owner say because I didn't want to wake up the neighbours.

 

integer on  = FALSE;
key owner;
default{ state_entry() { owner = llGetOwner(); } touch_start(integer total_number) { key touchingAvatar = llDetectedKey(0); if (owner == touchingAvatar) { if (on == FALSE) { llOwnerSay("device on" ); llTargetOmega(<0,0,2>, TWO_PI, 1); on = TRUE; } else { llOwnerSay("device off"); llTargetOmega(<0,0,1>, TWO_PI, 0); on = FALSE; } } }}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3485 days.

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
 Share

×
×
  • Create New...