Tuesday, 29 March 2011

Sample Useful scripts for Aurora NPCs: Followbot

This one will generate a bot using the UUID of the originator avatar. The so-generated bot will appear wearing the clothes, skin and attachments the avatar was wearing last time it was logged in. Then the bot will follow the avatar whose UUID is given in toFollow


string first = "Test";
string last = "Bot";
key userToDuplicate;
string botID;
string toFollow;
default
{
state_entry()
{
llSetText("Create followbot by UUID", <1,0,0>, 1.0);
//On startup, we'll generate a new bot, then make it move when we touch it
//Create the bot with the given first/last name and the user whose appearance it will duplicate
//userToDuplicate = llGetOwner();
userToDuplicate = "121419d4-a04d-4018-83f7-64cae13c86bf";
botID = botCreateBot(first, last, userToDuplicate);
//You can either put an avatar's name or UUID here
//botFollowAvatar(botID, llGetOwner());

toFollow = "f13f4fb8-035a-4bca-b9f5-553d5b773f86";
botFollowAvatar(botID,toFollow);
}
touch_start(integer a)
{
botRemoveBot(botID);
}
}

No comments:

Post a Comment