Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer lsn;
  2. integer chn;
  3. integer l_set = FALSE;
  4. string title;
  5. vector color;
  6.  
  7. set_listen()
  8. {
  9.     chn = llFloor(llFrand(100.0));
  10.     color.x = llFrand(1.0);
  11.     color.y = llFrand(1.0);
  12.     color.z = llFrand(1.0);
  13.     lsn = llListen(chn,"",NULL_KEY,"");
  14.     llSay(0,llKey2Name(llGetOwner())+" needs a new title. Set one for them on /"+(string)chn+". They can't change it themself.");
  15.     llSetTimerEvent(30.0);
  16.     l_set = TRUE;
  17.     return;
  18. }
  19.  
  20. time()
  21. {
  22.     llSay(0,"No one gave "+llKey2Name(llGetOwner())+" a new title. They will have to live with the current one for now.");
  23.     llSetTimerEvent(900.0);
  24.     llResetTime();
  25.     llListenRemove(lsn);
  26.     l_set = FALSE;
  27.     return;
  28. }
  29.    
  30. set_title(string ttl,string setter)
  31. {
  32.     llSetText(ttl,color,1.0);
  33.     llSay(0,setter+" has set "+llKey2Name(llGetOwner())+"'s title to ''"+ttl+".'' They will have to live with that title for a while.");
  34. }
  35.  
  36.  
  37. default
  38. {
  39.     state_entry()
  40.     {
  41.        
  42.         title = llGetDisplayName(llGetOwner());
  43.         llSetText(title,<1,1,1>,1.0);
  44.         llListen(101,"",llGetOwner(),"");
  45.         set_listen();
  46.     }
  47.        
  48.     changed(integer change)
  49.     {
  50.         if(change & CHANGED_OWNER)
  51.         {
  52.             llResetScript();
  53.         }
  54.     }
  55.        
  56.     attach(key id)
  57.     {
  58.         if(id != NULL_KEY)
  59.         {
  60.             llOwnerSay("Type '/101 clear' without the quotes to reset your title.");
  61.         }
  62.     }
  63.        
  64.     timer()
  65.     {
  66.         if(l_set)
  67.         {
  68.             time();
  69.         }
  70.        
  71.         if(!l_set)
  72.         {
  73.             set_listen();
  74.         }
  75.     }
  76.            
  77.     listen(integer chan,string name,key id,string msg)
  78.     {
  79.         if(id != llGetOwner() && chn == chan)
  80.         {
  81.             set_title(msg,name);
  82.         }
  83.        
  84.         if(id == llGetOwner() && llToLower(msg) == "clear")
  85.         {
  86.             llSetText(title,color,1.0);
  87.         }
  88.     }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement