OsNpcCreate
From OpenSimulator
(Difference between revisions)
Line 7: | Line 7: | ||
| | | | ||
ossl_example = <source lang="lsl"> | ossl_example = <source lang="lsl"> | ||
− | + | // touch to create npc in front of this emitter | |
− | + | // touch again to destroy | |
+ | |||
+ | key npc; | ||
+ | |||
+ | default | ||
+ | { | ||
touch_start(integer number) | touch_start(integer number) | ||
{ | { | ||
− | + | vector npcPos = llGetPos() + <1,0,0>; | |
− | + | npc = osNpcCreate("Jane", "Bot", npcPos, llGetOwnerKey(llGetKey())); | |
+ | state hasNPC; | ||
} | } | ||
− | + | } | |
+ | |||
+ | state hasNPC | ||
+ | { | ||
+ | touch_start(integer number) | ||
+ | { | ||
+ | osNpcRemove(npc); | ||
+ | npc = NULL_KEY; | ||
+ | state default; | ||
+ | } | ||
+ | } | ||
</source> | </source> | ||
| | | |
Revision as of 05:02, 30 June 2011
key osNpcCreate(string firstname, string lastname, vector position, key cloneFrom); | |
No descriptions provided | |
Threat Level | High |
Permissions | No permissions specified |
Extra Delay | No function delay specified |
Example(s) | |
// touch to create npc in front of this emitter // touch again to destroy key npc; default { touch_start(integer number) { vector npcPos = llGetPos() + <1,0,0>; npc = osNpcCreate("Jane", "Bot", npcPos, llGetOwnerKey(llGetKey())); state hasNPC; } } state hasNPC { touch_start(integer number) { osNpcRemove(npc); npc = NULL_KEY; state default; } } | |
Notes | |
*This function creates a NPC(Non Player Character) clone from an already existing avatar UUID Key.
|