Advertisement
Dorex

Untitled

Dec 15th, 2023
1,256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. integer hudchan = -387429; //channel huds communicate on
  3. integer started;
  4.  
  5.  
  6. default
  7. {
  8.     state_entry()
  9.     {
  10.         llListen(hudchan,"","","");
  11.     }
  12.  
  13.     touch_start(integer total_number)
  14.     {
  15.         if (llDetectedKey(0) == llGetOwner())
  16.         {
  17.             if (llDetectedTouchFace(0) == 1)
  18.             {
  19.                 if (started == TRUE)
  20.                 {
  21.                     llOwnerSay("touched buzzer");
  22.                 }
  23.                 else
  24.                 {
  25.                     llOwnerSay("you can only buzz in when the quiz buzzer system is started");
  26.                 }
  27.             }
  28.         }
  29.     }
  30.  
  31.     listen (integer channel, string name, key id, string msg)
  32.     {
  33.         list templist = llParseString2List(msg,["#"],[""]);
  34.         key recievedkey = llList2Key(templist,0);
  35.         string command = llList2String(templist,1);
  36.         llOwnerSay("recievedkey: " +(string)recievedkey+ " command: "+command);
  37.  
  38.         if (recievedkey == llGetCreator())
  39.         {
  40.             if (command == "Start")
  41.             {
  42.                 started = TRUE;
  43.                 llOwnerSay("quiz buzzer system is now started. You can now buzz in when required by touching the big yellow button on your buzzer hud");
  44.             }
  45.             if (command == "Stop")
  46.             {
  47.                 started = FALSE;
  48.                 llOwnerSay("quiz buzzer system is now stopped. You can no longer touch the big yellow button to buzz in until the system is started again");
  49.             }
  50.         }
  51.     }
  52.  
  53.     changed (integer change)
  54.     {
  55.         if (change & CHANGED_OWNER)
  56.         {
  57.             llOwnerSay("new hud owner detected " + llGetUsername(llGetOwner()) + " Welcome to the quiz buzzer system. The big yellow button on your hud is your quiz buzzer, when the sytem is active you can click it to buzz in");
  58.         }
  59.     }
  60.  
  61.     attach(key id)
  62.     {
  63.         if (id)
  64.         {
  65.             llOwnerSay("hud attached and running");
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement