Difference between revisions of "Go transparent when walking"

From Second Life Wiki
Jump to navigation Jump to search
(New page: == A what? == An attachment that goes invisible when you walk and when you stop walking it becomes visible again. I don't know what this could be used for, though. <lsl>//Emmas Seetan ...)
 
m (simplified example script)
Line 3: Line 3:
An attachment that goes invisible when you walk and when you stop walking it becomes visible again. I don't know what this could be used for, though.
An attachment that goes invisible when you walk and when you stop walking it becomes visible again. I don't know what this could be used for, though.


<lsl>//Emmas Seetan
<lsl>
//21 September, 16:57
key owner = llGetOwner();
 
integer WALKING = FALSE; //just a string
default
default
{
{
    on_rez(integer start_param)
    state_entry()
    {
    {
        llResetScript();
       
    }
        llSetTimerEvent(1);
 
    }
    changed(integer change)
   
    {
               
        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
           
            llResetScript();
       
    }
   
 
    on_rez(integer sparam){
    state_entry()
        WALKING = FALSE;
    {
        llSetTimerEvent(.5);
        owner = llGetOwner();
    }
        llSetTimerEvent(1.0);
   
    }
    timer(){
 
        if(WALKING == FALSE){
    timer()
            if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING){
    {
                WALKING = TRUE;
        integer ownerInfo = llGetAgentInfo(owner);
               
 
                  llSetAlpha(0.0,ALL_SIDES); //when you're walking it will go invisible
        if(ownerInfo & AGENT_WALKING)
               
            llSetAlpha((float)FALSE, ALL_SIDES);
            }
        else
        }
            llSetAlpha((float)TRUE, ALL_SIDES);
        else{
    }
            if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING){
}
            }
</lsl>
            else{
                WALKING = FALSE;
                                llSetAlpha(1.0,ALL_SIDES); //when you're not walking it will go visible
               
            }
        }
       
    }
}</lsl>

Revision as of 13:45, 7 October 2012

A what?

An attachment that goes invisible when you walk and when you stop walking it becomes visible again. I don't know what this could be used for, though.

<lsl> key owner = llGetOwner();

default {

   on_rez(integer start_param)
   {
       llResetScript();
   }
   changed(integer change)
   {
       if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
           llResetScript();
   }
   state_entry()
   {
       owner = llGetOwner();
       llSetTimerEvent(1.0);
   }
   timer()
   {
       integer ownerInfo = llGetAgentInfo(owner);
       if(ownerInfo & AGENT_WALKING)
           llSetAlpha((float)FALSE, ALL_SIDES);
       else
           llSetAlpha((float)TRUE, ALL_SIDES);
   }

} </lsl>