Advertisement
Blackforge4791

Touch_Hold_Access Menu

Mar 16th, 2021
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. integer TouchIt;  
  4. //---------------------------------------------------------------------------------------------------------//
  5. integer MenHan;
  6. integer MenChan;
  7. MyMenu(key user,string title,list buttons)
  8. {
  9.     MenChan = (integer)(llFrand(99999.0) * -1);
  10.     MenHan = llListen(MenChan,"","","");
  11.     llDialog(user,title,buttons,MenChan);
  12.     llSetTimerEvent(10.0);
  13. }
  14.  
  15. //------------------------------------------------------------------------------------------------------------------------//
  16.  
  17. default
  18. {
  19.     state_entry()
  20.     {
  21.     //??    
  22.     }
  23. //------------------------------------------------------------------------------------------------------------------------//    
  24.     touch_start(integer n)
  25.     {
  26.         TouchIt = FALSE;//HERE, before llResetTime() otherwise it doesn't run        
  27.         llResetTime();
  28.     }    
  29.  //------------------------------------------------------------------------------------------------------------------------//
  30.     touch(integer n)
  31.     {
  32.         if (llGetTime() > 1.0 && TouchIt == FALSE)
  33.             {    
  34.                 MyMenu(llDetectedKey(0),"Owner Setup Menu",["Owner","Group","Public"]);
  35.                 llSay(0,"Thank you for using X");
  36.                 TouchIt = TRUE;                
  37.             }
  38.             timer()
  39.             {
  40.                 llSetTimerEvent(0.0);
  41.                 llListenRemove(MenHan);
  42.             }
  43.             listen(integer channel,string name,key id,string message)
  44.             {
  45.                 if (channel == MenChan)
  46.                 {
  47.                     if(message == "Owner")
  48.                     {
  49.                     //do stuffs
  50.                     }
  51.                     else if(message == "Group")
  52.                     {
  53.                     //do other stuffs
  54.                     }
  55.                     else if(message == "Public")
  56.                     {
  57.                     //do other stuffs
  58.                     }
  59.                 }
  60.             }
  61.         }
  62.     }
  63. //------------------------------------------------------------------------------------------------------------------------//
  64.     touch_end(integer n)
  65.     {
  66.         if (llGetTime() <= 1.0)
  67.             {        
  68.             //set to give item...
  69.             }                  
  70.     }    
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement