Jump to content

trondvis

Resident
  • Posts

    2
  • Joined

  • Last visited

Posts posted by trondvis

  1. Hi,

    I have tried for Linden scripting for animating a linked mesh.The mesh is animated and also a touch event is initiated .The code is below

    integer total_prims;
    integer link_counter;
    string strNotecard;
    default
    {
        state_entry()
        {
            total_prims = llGetNumberOfPrims();
            llSay(0, (string) total_prims);
            llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);
            llSetTimerEvent (0.2);
        }
        
        timer()
        {
            integer next_link_counter = (link_counter % total_prims) + 1;
            llSetLinkPrimitiveParamsFast( link_counter,
                [ PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, 0.0
                , PRIM_LINK_TARGET, next_link_counter
                , PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, 1.0
                ]);
            link_counter = next_link_counter;
        
             strNotecard = llGetInventoryName(INVENTORY_NOTECARD,0);
              if(llGetInventoryType(strNotecard)!=INVENTORY_NOTECARD)
               {
                 llOwnerSay("There is no notecard in my inventory!");
            }
            else { 
                llOwnerSay("I have found a notecard called "+strNotecard+" and I will give that to whoever touches me.");
            }
        }
         touch_start(integer num_detected)
        {
            if(strNotecard){ 
            llGiveInventory(llDetectedKey(0), strNotecard); 
            }
        }
       changed(integer change) 
        { 
            if(change & CHANGED_INVENTORY){
                llResetScript();
            } 
    }
    }

     

    The script is working fine but there is one problem !!

    The  message  

    I have found a notecard called "+strNotecard+" and I will give that to whoever touches me.

    is coming repeatedly   .

    How can i get out of this problem

     

×
×
  • Create New...