All button.lsl

From Second Life Wiki
Revision as of 09:54, 25 January 2015 by ObviousAltIsObvious Resident (talk | contribs) (<lsl> tag to <source>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
// Global Variables

integer toAllChannel = -255;                    // general channel - linked message

default
{
    state_entry()
    {
        llSetColor( <0,0,0>, ALL_SIDES);
    }

    touch_start(integer total_number)
    {
        llMessageLinked(LINK_ALL_OTHERS, toAllChannel, "SetTestSelected::ALL", NULL_KEY);
        llSetColor( <0,0,0>, ALL_SIDES);
    }

///////////////////////////////////////////////////////
//  Link Message of default state                    //
///////////////////////////////////////////////////////   
    link_message(integer sender_number, integer number, string message, key id)
    {
        //if link message is on the correct channel
        if(number == toAllChannel)
        {
            if(llSubStringIndex( message, "TestSelectedButton") != -1)
            {
                llSetColor( <255,255,255>, ALL_SIDES);
            }
            if(message == "reset")
            {
                llResetScript();
            }
            
        }
        
    } //end of link message
    
}