Jump to content

Modifying a "rear slap" script.


Perg0
 Share

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

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

Recommended Posts

I have been working on making an animation trigger when you press an object.

BUT! whenever someone presses the object the animation triggers on them... I might be stupid but i don't understand what in the code is "broken".

"MY UUID" - is ofc my profile key just a placeholder for the fourm here.

 

Thanks alot in advance! ^w^

The original script from: http://wiki.secondlife.com/wiki/LlStartAnimation

 

default

{
    touch_start(integer detected)
    {
        llRequestPermissions("MY UUID", PERMISSION_TRIGGER_ANIMATION);
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
           
llStartAnimation("Butt");
           
llSetTimerEvent(1.0);
        }
    }
   
timer()
    {
       
llSetTimerEvent(0.0);
       
llStopAnimation("Butt");
    }
}

 

 

#############

Thanks for takeing the time to read and help! sorry for the bad english.

~Pergo

Edited by Perg0
Added colors for potential better viewing.
Link to comment
Share on other sites

I'm not sure that I understand the problem.  The script is simple enough. I assume that you have included the animation named "Butt" in the scripted object, because the script clearly can't use it if it's missing.  I also assume that you are actually putting your own UUID in place of the words "MY UUID".  

Exactly what sort of error message are you getting that makes you believe that something is "broken"?

  • Like 1
Link to comment
Share on other sites

Ah yes. I have both added "Butt" and my own UUID

 

The problem is when a friend touches the object he runs the "Butt" animation. It's suppose to run on me insted. (it's a slapper)

Thanks for the quick respons :D

Link to comment
Share on other sites

I see.  Well, it ought to work.  You might try something entirely different, though:

default
{
    attach(key id)
    {
        if (id)
        {
            llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
        }
    }

    run_time_permissions( integer perm )
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llOwnerSay("Permissions granted automatically. Ready to use....");
        }
    }

    touch_start (integer num)
    {
        if ( llGetPermissions() & PERMISSION_TRIGGER_ANIMATION )
        {
            llOwnerSay("Slapped by " + llDetectedName(0) );
            llStartAnimation("Butt");
            llSetTimerEvent(1.0);
        }
    }

    timer()
    {
        llSetTimerEvent(0.0);
        llStopAnimation("Butt");
    }
}

Then put that script into a prim, attach it to your avatar, and give it a test.  

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1487 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...