Seats.lsl 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // :SHOW:
  2. // :CATEGORY:Tour
  3. // :NAME:OpenSim Tour Car
  4. // :AUTHOR:Ferd Frederix
  5. // :KEYWORDS:
  6. // :CREATED:2015-02-25 22:55:43
  7. // :EDITED:2015-02-25 21:55:43
  8. // :ID:1040
  9. // :NUM:1723
  10. // :REV:1
  11. // :WORLD:Opensim or Secondlife
  12. // :DESCRIPTION:
  13. // Tour car seat for Multi-vehicle script - place this in any seat and adjust the TARGET and ROT as necessary
  14. // :CODE:
  15. vector TARGET = <0,0,0.1>; // sit position on the root prim. Ste this to <0,0,0> if you want to not to be able to sit on the base
  16. vector ROT = <0,0,0>; // and the rotation, if they sit
  17. default
  18. {
  19. state_entry()
  20. {
  21. llSetCameraEyeOffset(<5, 0, 0> );
  22. llSetCameraAtOffset(<0, 0, 1>);
  23. rotation rot = llEuler2Rot(ROT * DEG_TO_RAD); // convert the degrees to radians,
  24. // then convert that vector into a rotation
  25. llSitTarget(TARGET, rot); // where they sit
  26. }
  27. changed( integer what )
  28. {
  29. if (what & CHANGED_LINK)
  30. {
  31. key av = llAvatarOnSitTarget();
  32. if (av != NULL_KEY) {
  33. llMessageLinked(LINK_SET,0, "Sit","");
  34. }
  35. }
  36. }
  37. }