Prim Face Identifier

Various Scripts and Tricks to Scripting in LSL and OSSL for OpenSimulator
Post Reply
User avatar
nebadon
Site Admin
Posts: 107
Joined: Mon Feb 11, 2008 5:46 pm

Thu May 21, 2015 12:02 pm

Code: Select all

// This is an extremely simple script to identify the number of the face clicked.
// Useful primarily for taking the numbers and using them with scripts that
// affect faces on a prim (for example texture modifiers).
//
// - Xugu Madison

default
{
    on_rez(integer param)
    {
        llResetScript();
    }
    
    state_entry()
    {
        llOwnerSay("Touch me to identify the number of each face on this prim.");
    }

    touch_start(integer touchCount)
    {
        integer touchIdx;
        
        for (touchIdx = 0; touchIdx < touchCount; touchIdx++)
        {
            if (llDetectedKey(touchIdx) != llGetOwner())
            {
                return;
            }
            llOwnerSay("You touched face #"
                + (string)llDetectedTouchFace(touchIdx) + ".");
        }
    }
}


Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest