Advertisement
gguitar

Linkset Texture change updated

Sep 5th, 2018
996
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //linkset texture changer using llSetLinkPrimitiveParamsFast
  2. // setup for furniture cloth changer
  3. // G.Guitar 2015.03.03
  4.  
  5. //Variables to make this easier for me, anyway
  6.  
  7. // set face values here, then use the variable name in the parameters
  8.  
  9. integer facea = 3;
  10. //integer faceb = 0;
  11.  
  12.  
  13. // set link numbers here, then use the variable name in the parameters
  14. // linkset flags to use instead of numbers
  15. // LINK_ROOT
  16. // LINK_SET (all prims)
  17. // LINK_ALL_OTHERS (all other prims)
  18. // LINK_ALL_CHILDREN (everything but the root)
  19. // LINK_THIS (the prim the script is in)
  20.  
  21. //integer linkno1 = 2;
  22. //integer linkno2 = 4;
  23. integer linkno5 = 5;
  24. //integer linkno4 = 6;
  25. //integer linkno5 = LINK_ALL_OTHERS; // this one commented in the active part of the script - uncomment BOTH to make it active
  26.  
  27. integer texture;
  28. integer total;
  29.  
  30. default {
  31.     state_entry() {
  32.         total = llGetInventoryNumber(INVENTORY_TEXTURE);
  33.     }
  34.  
  35.     touch_start(integer number) {
  36.         integer i = llGetNumberOfPrims();
  37.  
  38.         for( ; i >= 0; --i ) {
  39. //            llSetLinkPrimitiveParamsFast (linkno1, [PRIM_TEXTURE, facea, (llGetInventoryName(INVENTORY_TEXTURE, texture)), <1,1,0>, <0,0,0>, 0]);
  40. //            llSetLinkPrimitiveParamsFast (linkno2, [PRIM_TEXTURE, facea, (llGetInventoryName(INVENTORY_TEXTURE, texture)), <1,1,0>, <0,0,0>, 0]);
  41. //            llSetLinkPrimitiveParamsFast (linkno3, [PRIM_TEXTURE, facea, (llGetInventoryName(INVENTORY_TEXTURE, texture)), <1,1,0>, <0,0,0>, 0]);
  42. //            llSetLinkPrimitiveParamsFast (linkno4, [PRIM_TEXTURE, facea, (llGetInventoryName(INVENTORY_TEXTURE, texture)), <1,1,0>, <0,0,0>, 0]);
  43.         llSetLinkPrimitiveParamsFast (linkno5, [PRIM_TEXTURE, facea, (llGetInventoryName(INVENTORY_TEXTURE, texture)), <4,4,0>, <0.5,0.5,0>, 0]);
  44.         }
  45.  
  46.          ++texture;
  47.  
  48.          if( texture == total )
  49.             texture = 0;
  50.     }
  51.  
  52.     changed(integer change) {
  53.         if( change & CHANGED_INVENTORY ) {
  54.             llResetScript();
  55.         }
  56.     }
  57. }
  58.  
  59. // end script
  60. //============================
Advertisement
RAW Paste Data Copied
Advertisement