Jump to content

trying to make a llListen animation script work, help?


WickedAndWild
 Share

You are about to reply to a thread that has been inactive for 679 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

so im trying to get a llSay from the same wearable object in a differant script that triggers on touch from someone else to register with this script to trigger an animation on me (owner), and i cant figure out what im doing wrong, any help is appreciated, or even if someones willing to fix the mistake would be even better

 

 

 

string productName = "Product Name";
integer channel = 9;

default
{
        changed(integer change)
    {
        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
            llResetScript();
    }
    state_entry()
{
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
}


    run_time_permissions(integer perm) 
        { 
               if(PERMISSION_TRIGGER_ANIMATION & perm)
        {
            llListen( channel, productName, NULL_KEY, "" );
        }
        }
        
        listen(integer chan, string name, key id, string msg)
    {
        list detail = llGetObjectDetails(id,[OBJECT_OWNER]);
         if(llList2Key(detail,0)  != llGetOwner())
             return;
{
        if( msg == "Anim")
{
        llStartAnimation("Anim1");
        llSetTimerEvent(0.3);
     }      
         else
    {
        llStopAnimation("Anim1");
    }
    }
            }
            timer()
    {
        llSetTimerEvent(0.0);
        llStopAnimation("Anim1");
    }
    }

Edited by WickedAndWild
Link to comment
Share on other sites

Try removing the name of the desired object from the listen setup. Then, just inside the listen, llOwnerSay(name + " " + msg) to see exactly what is being received.

 

It's possible that the touched object isn't sending any message, so again, in that script, llOwnerSay() exactly what is being said on that channel so you can compare the results of the touch with the results of the listen events.

  • Like 1
Link to comment
Share on other sites

7 hours ago, WickedAndWild said:

list detail = llGetObjectDetails(id,[OBJECT_OWNER]);
         if(llList2Key(detail,0)  != llGetOwner())
             return;

They're entirely equivalent, but you can also use

if(llGetOwnerKey(id) != llGetOwner()) return;

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 679 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...