Benja Kepler’s SL Blog

Dance Animation

March 16, 2008 · Leave a Comment

1. A single animation

Script:
default
{
state_entry()
{

}

touch_start(integer total_number)
{
llRequestPermissions(llDetectedKey(0),PERMISSION_TRIGGER_ANIMATION);
}

run_time_permissions( integer perm )
{
if(PERMISSION_TRIGGER_ANIMATION & perm)
{
llStartAnimation("Dance - Horizon Loop");
}

}
}

2. A choice of dances

Copy and paste the script:
list dances = ["Horizon","Kick"];
string dance_chosen;
key avatar;

default
{
state_entry()
{

}

touch_start(integer total_number)
{
avatar = llDetectedKey(0);
llDialog(avatar,
"Choose a Dance",
dances,
11);

llListen(11,"",NULL_KEY,"");
}

listen(integer channel,
string name,
key id,
string message)
{
dance_chosen = message;
llRequestPermissions(avatar,
PERMISSION_TRIGGER_ANIMATION);
}

run_time_permissions( integer perm )
{
if(PERMISSION_TRIGGER_ANIMATION & perm)
{
llStartAnimation(dance_chosen);
}

}
}

Categories: Scripting · Tutorials

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment