- 0
Sound for each animation Script
You are about to reply to a thread that has been inactive for 2465 days.
Please take a moment to consider if this thread is worth bumping.
Please take a moment to consider if this thread is worth bumping.
Question
Sunbleached
Hello! I want to create a script that allows you to make sounds for each animation. Running, jumping, swimming, walking etc. Like a simple walker, only more animations/sounds. I was advised to use this script http://wiki.secondlife.com/wiki/LlGetAnimation. But I did not quite manage to adapt it for sounding. Please tell where the error is. I wrote on the forum. Thanks for any help.
string SOUND_WALK = "34eae688-8b2d-d86c-5c1e-4e3eb865ca0d"; string SOUND_RUN = "b1c0f5e2-45e5-e0b2-926a-fd60520ed4ee"; key gOwner; string gLastAnimation; Initialize(key id) { if (id == NULL_KEY) { llSetTimerEvent(0.0); } else { llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); gOwner = id; } } default { state_entry() { if (llGetAttached() != 0) { Initialize(llGetOwner()); } } attach(key id) { Initialize(id); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llSetTimerEvent(0.25); } } timer() { string newAnimation = llGetAnimation(gOwner); if (gLastAnimation != newAnimation) { if (newAnimation == "Walking") { llLoopSound( SOUND_WALK, 1.0); } if (gLastAnimation == "Running") { llLoopSound( SOUND_RUN, 1.0); } else { llStopSound(); } gLastAnimation = newAnimation; } } }
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
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