Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer gListener;     // Identity of the listener associated with the dialog, so we can clean up when not needed
  2.  
  3. default
  4. {
  5.     touch_start(integer total_number)
  6.     {
  7.         // Kill off any outstanding listener, to avoid any chance of multiple listeners being active
  8.         llListenRemove(gListener);
  9.         // get the UUID of the person touching this prim
  10.         key user = llDetectedKey(0);
  11.         // Listen to any reply from that user only, and only on the same channel to be used by llDialog
  12.         // It's best to set up the listener before issuing the dialog
  13.         gListener = llListen(-99, "", user, "");
  14.         // Send a dialog to that person. We'll use a fixed negative channel number for simplicity
  15.         llDialog(user, "\nDo you wish this prim to die?", ["Give to...", "Get Group..." ] , -99);
  16.         // Start a one-minute timer, after which we will stop listening for responses
  17.         llSetTimerEvent(60.0);
  18.     }
  19.     listen(integer chan, string name, key id, string msg)
  20.     {
  21.         // If the user clicked the "Yes" button, kill this prim.
  22.         if (msg == "Give to...")
  23.             {
  24.             integer channel = -13572468;
  25.         // "" saves byte-code over NULL_KEY
  26.         gListener = llListen( channel, "", "", "");    
  27.         llTextBox(llDetectedKey(0), "Some info text for the top of the window...", channel);
  28.     }
  29.     listen(integer channel, string name, key id, string message)
  30.         {    llListenRemove(gListener);
  31.        name_key_query = llRequestUserKey(message);
  32.    }
  33.  
  34.    dataserver(key queryid, string data)
  35.    {
  36.        if ( name_key_query == queryid )
  37.        {
  38.            llGiveInventory( data,"Revenland Dice v1.4");
  39.           }
  40.    }
  41.        
  42. //Insert Else command here
  43.  
  44.      {
  45.         llOwnerSay("Here is a link to the secondlife:///app/group/e5c17f1d-fa0b-8a6e-ef62-940d71be398c/about group.");
  46.         // Stop listening. It's wise to do this to reduce lag
  47.         llListenRemove(gListener);
  48.         // Stop the timer now that its job is done
  49.         llSetTimerEvent(0.0);// you can use 0 as well to save memory
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement