Advertisement
worstbull

small fire

Nov 2nd, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. key kT1 = "21eeb911-d57a-6a7b-44cd-b9d905860ac6";
  2. key kT2 = "fcf3ce95-b924-c340-6f16-7f8c25196b1d";
  3. key kT3 = "af80baaf-f7e1-c70b-2b1a-1faa6623d3a0";
  4. key kT4 = "00c3fd93-75fe-3e59-3323-5856256d96c2";
  5. list lFire = [kT1, kT2, kT3, kT4];
  6. key kTEXTURE_INVISIBLE = "bd7d7770-39c2-d4c8-e371-0342ecf20921";
  7. vector vREPEATS = <1.0, 1.0, 0.0>;
  8. float fTimer = 0.03;
  9. integer iStartCounter = 0;
  10. integer iCounter = iStartCounter;
  11. integer iMaxCounter = 3;
  12.  
  13. integer iCHANNEL = 23498;
  14. string sSTART = "start fire";
  15. string sSTOP = "stop fire";
  16. string sTEXT = "Select an option:";
  17. integer iLISTEN;
  18.  
  19. integer iCHANNEL_LOCAL = 23499;
  20. default
  21. {
  22.     state_entry()
  23.     {
  24.         llListen(iCHANNEL_LOCAL, "", "", "");
  25.     }
  26.     touch_start(integer num_detected)
  27.     {
  28.         iLISTEN = llListen(iCHANNEL, "", llDetectedKey(0), "");
  29.         llDialog(llDetectedKey(0), sTEXT, [sSTART, sSTOP], iCHANNEL);
  30.     }
  31.     listen(integer channel, string name, key id, string message)
  32.     {
  33.         llListenRemove(iLISTEN);
  34.         if (message == sSTART)
  35.         { //start fire
  36.             if (channel != iCHANNEL_LOCAL)
  37.             {
  38.                 llWhisper(iCHANNEL_LOCAL, sSTART);
  39.             }
  40.             llSetTimerEvent(fTimer);
  41.         }
  42.         else if (message == sSTOP)
  43.         { //stop fire
  44.             llSetTimerEvent(0.0);
  45.             if (channel != iCHANNEL_LOCAL)
  46.             {
  47.                 llWhisper(iCHANNEL_LOCAL, sSTOP);
  48.             }
  49.             llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, kTEXTURE_INVISIBLE, vREPEATS, ZERO_VECTOR, 0.0]);
  50.         }
  51.     }
  52.     timer()
  53.     {
  54.         key kTexture = llList2Key(lFire, iCounter++);
  55.         llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, kTexture, vREPEATS, ZERO_VECTOR, 0.0]);
  56.         if (iCounter > iMaxCounter)
  57.         {
  58.             iCounter = iStartCounter;
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement