Advertisement
Gayngel

Untitled

Dec 16th, 2015
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. // Poseball & Furniture script
  2. // by Daemonika Nightfire (2009/2010)
  3. // NO License! that script is free for all.
  4.  
  5. // why poseball and Furniture?...
  6. // ...just delete all funktions with show/hide and it works for Furniture too.
  7. // llSitTarget(<-0.1,0.1,-0.43>... set the Avatar Position to the prim in meters,
  8. // ...,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD)); set the angle Rotation from the Avatar in 3 axis <x,y,z>.
  9.  
  10. // why no script error at crashing Avatar?...
  11. // ...llKey2Name ask for sitting Avatarname...
  12. // ...is there no name, so nobody there for stop animation and the script will show the Ball only.
  13.  
  14. string anim;
  15. integer sitting;
  16. show()
  17. {
  18. llSetPrimitiveParams([PRIM_TEXT,"SIT HERE",<0.9,0.6,0.2>,1.0, PRIM_COLOR, ALL_SIDES,<1,1,1>,1.0]);
  19. }
  20. hide()
  21. {
  22. llSetPrimitiveParams([PRIM_TEXT,"",ZERO_VECTOR,0.0, PRIM_COLOR, ALL_SIDES,ZERO_VECTOR,0.0]);
  23. }
  24. default
  25. {
  26. state_entry()
  27. {
  28. show();
  29. sitting = 0;
  30. anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
  31. llSitTarget(<-0.1,0.1,-0.43>,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD));
  32. }
  33. run_time_permissions(integer perm)
  34. {
  35. if (perm & PERMISSION_TRIGGER_ANIMATION)
  36. {
  37. sitting = 1;
  38. llStopAnimation("sit_generic");
  39. llStopAnimation("sit");
  40. llStartAnimation(anim);
  41. llSetTimerEvent(5.0);
  42. hide();
  43. }
  44. }
  45. changed(integer change)
  46. {
  47. if (change & CHANGED_LINK)
  48. {
  49. key avatar = llAvatarOnSitTarget();
  50. if (llKey2Name(avatar) != "")
  51. {
  52. llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
  53. }
  54. else
  55. {
  56. show();
  57. if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && sitting && llKey2Name(avatar) != "")
  58. {
  59. llStopAnimation(anim);
  60. }
  61. sitting = 0;
  62. }
  63. }
  64. if (change & CHANGED_OWNER + CHANGED_REGION_START + CHANGED_INVENTORY)
  65. {
  66. llResetScript();
  67. }
  68. }
  69. on_rez(integer start_param)
  70. {
  71. llResetScript();
  72. }
  73.  
  74. }
  75. timer()
  76. {
  77. llSetTimerEvent(0.0);
  78. llStopAnimation("sit");
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement