OsNpcCreate
From OpenSimulator
key osNpcCreate(string firstname, string lastname, vector position, key cloneFrom)
| |
| |
Threat Level | High |
Permissions | No permissions specified |
Extra Delay | No function delay specified |
Example(s) | |
// 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 key npc; vector toucherPos; default { touch_start(integer number) { vector npcPos = llGetPos() + <1,0,0>; npc = osNpcCreate("ImYour", "Clone", npcPos, llGetOwnerKey(llGetKey())); toucherPos = llDetectedPos(0); state hasNPC; } } state hasNPC { state_entry() { osNpcMoveTo(npc, toucherPos + <1,0,0>); // osNpcMoveTo will currently not work as intended. osNpcSay(npc, "Hi there! My name is " + llKey2Name(npc)); } touch_start(integer number) { osNpcSay(npc, "Good bye!"); osNpcRemove(npc); npc = NULL_KEY; state default; } } |