Jump to content

Newbie with a question - Can a Scripted object be scripted for muliple placements?


TetsuohOdai
 Share

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

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

Recommended Posts

Okay, Basically what I need to know is If you can script an object to run one script while placed (sandbox) and run another while equipped. And furthermore - run yet another when clicked while placed and another when clicked while equipped?

Also it possible to give an item a hud that allows the equipped items scripts to be changed? A script that allows the changing of scripts?

 

*bashes head on keyboard*

 

I'm new to terms - so I apologize for sounding like an idiot.

 

Link to comment
Share on other sites

if you need to do just one or two things, you could also use

a user defined function in stead of switching to a new state?

something like...

 

integer attached;integer rezzed;runAttachFunction(){ // code to do something when attached}runRezFunction(){ // code to do something when rezzed}default{    state_entry()                  // run whenever the script is reset    {    }     on_rez(integer start_param)  //run when rezzed or worn    { rezzed = TRUE;                   if(llGetAttached() )      { attached = TRUE;      }      if(attached)      { runAttachFunction();   // do something when attached      }      else      { runRezFunction();     // do something when rezzed      }    }        touch_start(integer total_number)    {  if(attached)       { llSay(0, "wearing.");  // do something if clicked while attached       }       else       { llSay(0, "rezzed.");  // do something if clicked while rezzed       }    }     changed(integer change)     // recheck perms by resetting script    {        if (change & CHANGED_TELEPORT | change & CHANGED_REGION)        { llResetScript();                   }    }}

 

___________________________________________

 you can use the changed event to recheck your perms on teleport or region change.

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2731 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...