Bonjour ,
J'ai trouvé un script que je n'arrive pas a modifier pour faire ce dont j'ai besoin .
J'ai besoin de créer un bouton a porter comme un hud , ou lorsque je clic dessus il me joue 3 animations et s’arrête à la fin de la 3eme automatiquement .
J'ai trouver cela si jamais une personne a une idée
list anims;
integer anim_index;
string current_playing;
key owner;
integer ready = FALSE;
integer playing = FALSE;
integer time = 10;
Play_Next_Animation()
{
anim_index = (anim_index + 1) % llGetListLength(anims);
llStopAnimation(current_playing);
current_playing = llList2String(anims,anim_index);
llStartAnimation(current_playing);
}
default
{
state_entry()
{
owner = llGetOwner();
integer total_anims = llGetInventoryNumber(INVENTORY_ANIMATION);
if(total_anims < 2)
{
llRegionSayTo(owner,0,"No animations found. Must add 2 or more animations to begin cycling!");
}
else
{
integer i;
while(i < total_anims)
{
anims += llGetInventoryName(INVENTORY_ANIMATION,i);
i++;
}
llRequestPermissions(owner,PERMISSION_TRIGGER_ANIMATION);
}
}
on_rez(integer start)
{
llResetScript();
}
touch_start(integer total_number)
{
if(!ready)
{
llResetScript();
}
else
{
if(playing)
{
llRegionSayTo(owner,0,"I will no longer cycle animations. Touch me to start again!");
playing = FALSE;
llStopAnimation(llList2String(anims,anim_index));
llSetTimerEvent(0);
}
else
{
llRegionSayTo(owner,0,"Cycling animations... Touch me to stop!");
playing = TRUE;
llSetTimerEvent(time);
current_playing = llList2String(anims,0);
llStartAnimation(current_playing);
}
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
ready = TRUE;
llRegionSayTo(owner,0,"Ready. Touch to start cycling.");
}
}
timer()
{
Play_Next_Animation();
}
}
merci d'avance
|