xs_sex OPTIONAL.lsl 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // :CATEGORY:XS Pet
  2. // :NAME:XS Pet Robot
  3. // :AUTHOR:Ferd Frederix
  4. // :KEYWORDS: Pet,XS,breed,breedable,companion,Ozimal,Meeroo,Amaretto,critter,Fennux,Pets
  5. // :CREATED:2013-09-06
  6. // :EDITED:2014-01-30 12:24:21
  7. // :ID:988
  8. // :NUM:1468
  9. // :REV:0.50
  10. // :WORLD:Second Life, OpenSim
  11. // :DESCRIPTION:
  12. // XS Pet script to make an xs_pet change prims when male or female
  13. // :CODE:
  14. //
  15. // LICENSE
  16. /////////////////////////////////////////////////////////////////////
  17. // This code is licensed as Creative Commons Attribution/NonCommercial/Share Alike
  18. // See http://creativecommons.org/liceses/by-nc-sa/3.0/
  19. // Noncommercial -- You may not use this work for commercial purposes, i.e., you cannot sell this script in any form, including derivatives.
  20. // If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
  21. // This means that you cannot sell this or derivative code by itself, but you may share and use this code in any object or virtual world.
  22. // You must attribute authorship in the scripts to Ferd Frederix and Xundra Snowpaw, and leave this notice intact.
  23. // You do not have to give back to the community any changes you make, however, code changes would be greatly appreciated!
  24. //
  25. // Exception: I am allowing this script to be used in an original build and sold with the build.
  26. // You are not selling the script, you are selling the build. If you want to sell these scripts, write your own or use the original at http://code.google.com/p/xspets/
  27. // Note: Xundra Snowpaw's license was 'New BSD' license and adding additional licenses is allowed. See http://opensource.org/licenses/BSD-3-Clause
  28. ////////////////////////////////////////////////////////////////////
  29. string sexType = "1"; // set to a "2" for female parts
  30. // Code begins //
  31. integer sex = 0 ; // no sex, 1 = male, 2 = female
  32. integer LINK_SEX = 932; // sex
  33. //
  34. default
  35. {
  36. state_entry()
  37. {
  38. llSetAlpha(0.0,ALL_SIDES); // 0 = invisible so we hide this part until we know our sex
  39. }
  40. on_rez(integer param)
  41. {
  42. llResetScript();
  43. }
  44. link_message(integer sender_num, integer num, string message, key id)
  45. {
  46. if (num == LINK_SEX )
  47. {
  48. if (message == "1") // Male
  49. {
  50. llSetAlpha(1.0,ALL_SIDES); // 1 = visible for male parts
  51. }
  52. else
  53. {
  54. llSetAlpha(0.0,ALL_SIDES); // 0 = invisible
  55. }
  56. }
  57. }
  58. }