Script bouton jouer 3 animations a la suite

Répondre
Partager Rechercher
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
teste ça.....



integer count;
integer nbanims;
float time = 10.0;
list anims;
key owner;

default
{
state_entry()
{
owner = llGetOwner();

nbanims = llGetInventoryNumber(INVENTORY_ANIMATION);
if(nbanims < 3)
{
llOwnerSay("No animations found. Must add 2 or more animations to begin cycling!");
}
else
{
integer i;
do
anims += llGetInventoryName(INVENTORY_ANIMATION,i++);
while(i < nbanims);
}
}

touch_end(integer total_number)
{
state marche;
}

changed(integer change)
{
if(change & CHANGED_INVENTORY)
{
llResetScript();
}

if(change & CHANGED_OWNER)
{
llResetScript();
}
}
}

state marche
{
state_entry()
{
count = 0;
llRequestPermissions(owner,PERMISSION_TRIGGER_ANIMATION);
}

run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
llOwnerSay("Ready. Let's moove !");
llStartAnimation( llList2String(anims,count));
llSetTimerEvent(time);
}
}

timer()
{
count++;

if(count < 3)
{
llStopAnimation(llList2String(anims,count-1));
llStartAnimation( llList2String(anims,count));
}

else if (count == 3)
{
llSetTimerEvent(0.0);
llStopAnimation(llList2String(anims,count-1));
state default;
}
}

touch_end(integer total_number)
{
llStopAnimation( llList2String(anims,count));
state default;
}

changed(integer change)
{
if(change & CHANGED_INVENTORY)
{
llStopAnimation( llList2String(anims,count));
llResetScript();
}

if(change & CHANGED_OWNER)
{
llStopAnimation( llList2String(anims,count));
llResetScript();
}
}
}
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés