llAvatarOnSitTarget.lsl 485 B

1234567891011121314151617181920
  1. default
  2. {
  3. state_entry()
  4. {
  5. // set sit target, otherwise this will not work
  6. llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);
  7. }
  8. changed(integer change)
  9. {
  10. if (change & CHANGED_LINK)
  11. {
  12. key av = llAvatarOnSitTarget();
  13. //evaluated as true if not NULL_KEY or invalid
  14. if (av)
  15. {
  16. llSay(0, "Hello " + llKey2Name(av) + ", thank you for sitting down");
  17. }
  18. }
  19. }
  20. }