// osNpcSit(, , OS_NPC_SIT_NOW) // e.g. osNpcSit(npc, llGetKey(), OS_NPC_SIT_NOW); // target object must have sit positon set explicitly // osNpcStand() // touch to create npc in front of this emitter // Npc will walk to the toucher, then will greet them. // Touch again to remove the NPC // http://opensimulator.org/wiki/OSSLNPC // http://opensimulator.org/wiki/OsNpcCreate // http://opensimulator.org/wiki/OsNpcRemove // http://opensimulator.org/wiki/OsNpcMoveTo // http://opensimulator.org/wiki/OsNpcSay string npcNoteCard = "NPC Appearance"; key npc; vector toucherPos; default { state_entry() { llSetText("NPC Sitdown (Owner Use Only)",<0.6,0.6,0.6>, 1.0); } touch_start(integer number) { vector npcPos = llGetPos() + <1,0,0>; llSay(0,(string)llDetectedKey(number)); if (llDetectedKey(0) == llGetOwner()) { osAgentSaveAppearance(llDetectedKey(0), npcNoteCard); npc = osNpcCreate("Sitting", "Clone", npcPos, npcNoteCard); // below for specific logged in avatar cloning via UUID // npc = osNpcCreate("ImYour", "Clone", npcPos, "e24a9015-f5ca-452b-8c95-d32e34cb9d64"); // below or temp copy of NPC without saving appearance // npc = osNpcCreate("ImYour", "Clone", npcPos, llGetOwnerKey(llGetKey())); toucherPos = llDetectedPos(0); state hasNPC; } else llSay(0,"Sorry, I only make NPCs for "+llKey2Name(llGetOwner())+"\n You are "+llKey2Name(llDetectedKey(number))); } } state hasNPC { state_entry() { osNpcSit(npc, llGetKey(), OS_NPC_SIT_NOW); // osNpcMoveTo(npc, toucherPos + <3,0,-5>); // -5 to make sure it lands - if avatar is on land osNpcSay(npc, "Hi there! My name is " + llKey2Name(npc)+" and I am sitting down."); } touch_start(integer number) { osNpcStand(npc); osNpcMoveTo(npc, toucherPos + <3,0,-5>); // -5 to make sure it is on land osNpcSay(npc, "Good bye!"); osNpcRemove(npc); npc = NULL_KEY; state default; } }