Change font size
It is currently Mon Nov 19, 2018 11:00 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Npc sit
PostPosted: Sat Jul 14, 2012 11:03 pm 

Joined: Tue Nov 16, 2010 7:45 am
Posts: 9
Simple rezz npc and have it sit. Script works with existing simple pose scripts OSG 7.4

{L_CODE}:
key gNpc = NULL_KEY;

callNpc()
{
    // Replace "" with first and last name
    gNpc = osNpcCreate("", "", llGetPos(), "appearance");
    llSleep(1.0);
    osNpcSit(gNpc, llGetKey(), 0);
}

dismissNpc()
{
    osNpcStand(gNpc);
    osNpcRemove(gNpc);
    gNpc = NULL_KEY;
}
   

default
{
    on_rez(integer rezed) { do { llSay(0, "Resetting..."); llResetScript(); } while (TRUE); }

    changed(integer change)
    {
        if ( change & (CHANGED_REGION_RESTART | CHANGED_REGION_START))
            do { llOwnerSay("Reseting..."); llResetScript(); } while (TRUE);
    }

    state_entry()
    {
        if (llGetInventoryType("appearance") == INVENTORY_NOTECARD) state running;
        else llOwnerSay("Click to make appearance.");
    }
   
    touch_end(integer touched)
    {
        if (llGetOwner() == llDetectedKey(0))
        {
            if (llGetLinkNumber() == llDetectedLinkNumber(0))
            {
                osOwnerSaveAppearance("appearance");
                state running;
            }
        }
    }
}

state running
{
    on_rez(integer rezed) { do { llSay(0, "Resetting..."); llResetScript(); } while (TRUE); }

    changed(integer change)
    {
        if ( change & (CHANGED_REGION_RESTART | CHANGED_REGION_START))
            do { llOwnerSay("Reseting..."); llResetScript(); } while (TRUE);
    }

    state_entry()
    {
        callNpc();
    }
   
    touch_end(integer touched)
    {
        if (llGetOwner() == llDetectedKey(0))
        {
            if (llGetLinkNumber() == llDetectedLinkNumber(0))
            {
                if (gNpc == NULL_KEY) callNpc();
                else dismissNpc();
            }
        }
    }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net