/AuroraDocs/BotFunctions/Av Following Bot.lsl

https://bitbucket.org/VirtualReality/software-testing · Unknown · 24 lines · 24 code · 0 blank · 0 comment · 0 complexity · ddcc6256e1e14bf78f242f2a7f915455 MD5 · raw file

  1. string first = "Test";
  2. string last = "Bot";
  3. key userToDuplicate;
  4. string botID;
  5. default
  6. {
  7. state_entry()
  8. {
  9. //On startup, we'll generate a new bot, then make it move when we touch it
  10. //Create the bot with the given first/last name and the user whose appearance it will duplicate
  11. userToDuplicate = llGetOwner();
  12. vector startPos = llGetPos();
  13. botID = botCreateBot(first, last, userToDuplicate, startPos);
  14. //You can either put an avatar's name or UUID as the second parameter, and then the last parameter is how close it should get to the avatar
  15. //The third and fourth parameters have to do with how far away the avatar can be before it follows
  16. // The third is how far away the avatar can be before it begins to follow them, and the fourth is how far away the avatar has to be before it stops attempting to follow the avatar
  17. botFollowAvatar(botID, llGetOwner(), 2, 2);
  18. }
  19. touch_start(integer a)
  20. {
  21. //Stop following the avatar now
  22. botStopFollowAvatar (botID);
  23. }
  24. }