OsNpcLoadAppearance

From OpenSimulator

Revision as of 13:13, 22 June 2015 by Chris Weymann (Talk | contribs)

Jump to: navigation, search
osNpcLoadAppearance(key npc, string notecard)
Load appearance from a notecard. This notecard must contain appearance data created with one of the save appearance functions.
Threat Level High
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
//Load an appearance notecard on the collided npc with the same name like the npc.
 
default
{
    collision_start(integer num) //On Collision
    {
        if(osIsNpc(llDetectedKey(0))) //Check is the the agent an npc
        {
            if(llGetInventoryType(llDetectedName(0)) == INVENTORY_NOTECARD) //is the notecard available
            {
                osNpcLoadAppearance(llDetectedKey(0), llDetectedName(0)); //load the new appearance
            }
        }
    }
}
Notes
An important hint:

This function works only for the npc owner.

You must create the npc with OsNpcCreate and the option OS_NPC_NOT_OWNED to allow all others to change the appearance.

Personal tools
General
About This Wiki