bouncewitmeyall

By: bdhtrn on Oct 8th, 2011  |  syntax: Linden Scripting  |  size: 1.07 KB  |  hits: 69  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. integer repflag=0;
  2. integer bounceflag=0;
  3. integer clickflag=0;
  4. integer chI_colval;
  5.  
  6. doit(){
  7.     float rForce = (llFrand(6)+7)*llGetMass();
  8.     float rand = llFrand(1.1);
  9.     llApplyImpulse(<0,0,rForce>, 0);
  10.     if(!repflag)
  11.         llSetTimerEvent(rand+2.1);
  12. }
  13.  
  14. default{
  15.     on_rez(integer param){
  16.         if(param!=0)
  17.             chI_colval=llListen(param,"","","");
  18.     }
  19.     state_entry(){
  20.         llSetStatus(STATUS_DIE_AT_EDGE,TRUE);
  21.         llListen(-777477,"","","");
  22.     }
  23.     listen(integer chan,string who,key id,string msg){
  24.         if(msg=="hup"){
  25.             if(bounceflag==0){
  26.                 bounceflag=1;
  27.                 doit();
  28.             }
  29.         }
  30.         else{
  31.             llSetColor((vector)msg,0);
  32.             llListenRemove(chI_colval);
  33.         }
  34.     }
  35.     timer(){
  36.         if(!repflag)
  37.             repflag=1;
  38.         else
  39.             doit();
  40.         if(clickflag==1)
  41.             llRegionSay(-777477,"hup");
  42.     }
  43.     touch_end(integer total_number){
  44.         llShout(-777477,"hup");
  45.         clickflag=1;
  46.         doit();
  47.     }
  48. }