OsNpcLoadAppearance

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Small changes)
(Remove wrong script)
Line 7: Line 7:
 
|delay=0
 
|delay=0
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
// Load an appearance notecard on the collided npc with the same name like the npc.
 
 
default
 
{
 
    collision_start(integer number)
 
    {
 
        key collider = llDetectedKey(0);
 
 
        if (osIsNpc(collider)) // Check is the collider an npc
 
        {
 
            if (llGetInventoryType(collider) == INVENTORY_NOTECARD) // Is the notecard available
 
            {
 
                osNpcLoadAppearance(collider, llDetectedName(0)); // Load the new appearance
 
            }
 
        }
 
    }
 
}
 
 
</source>
 
</source>
 
|additional_info=This function was added in 0.7.2-post-fixes
 
|additional_info=This function was added in 0.7.2-post-fixes

Revision as of 12:24, 4 December 2020

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 ${OSSL|osslNPC}
Extra Delay 0 seconds
Example(s)
 
Notes
This function was added in 0.7.2-post-fixes

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