From OpenSimulator

Revision as of 02:31, 16 August 2011 by Aiaustin (Talk | contribs)

Jump to: navigation, search
key osNpcCreate(string firstname, string lastname, vector position, string notecard)
  • Creates a NPC(Non Player Character) clone named firstname lastname at position from an already existing avatar cloneFrom.
Threat Level High
Permissions No permissions specified
Delay No function delay specified
// touch to create a NPC clone of the toucher in front of this emitter
// NPC will move to the toucher, then will greet them.
// Touch again to remove the NPC
key npc;
vector toucherPos;
    touch_start(integer number)
        vector npcPos = llGetPos() + <1,0,0>;
        osAgentSaveAppearance(llDetectedKey(0), "appearance");
        npc = osNpcCreate("ImYour", "Clone", npcPos, "appearance");
        toucherPos = llDetectedPos(0);
        state hasNPC;
state hasNPC
        osNpcMoveTo(npc, toucherPos + <3,0,0>); 
        osNpcSay(npc, "Hi there! My name is " + llKey2Name(npc));
    touch_start(integer number)
        osNpcSay(npc, "Good bye!");
        npc = NULL_KEY;
        state default;
Personal tools
About This Wiki