I'm having a little trouble with my script. I'm not exactly a novice programmer, but it's been a while since i've done any work with languages.
What i'm wanting to do is reset the script on rez, then when the object is clicked, play an animation and sound, then reset the script so that it can be clicked and played again. So far the anim and sound are working fine, but the resets dont seem to be happening. Pasted in is my current code. I've tried placing the llResetScript command in different places (to test and see what happens), and I've also tried creating a seperate state called after the playanim state, which only served to reset the script and return to default state.
When I attach the object and run once, it's just fine. Even if i detach and re-attach, it doesnt run
Any help is much appreciated...
Zura
string gAnimName = "BigHammer";
string gSoundName = "Squeak";
default
{
on_rez(integer start_param)
{
llResetScript();
}
state_entry()
{
llSay(0, "Looking for someone to BONK!"
;}
touch_start(integer total_number)
{
llSay(0, "Look Out!!"
;state playanim;
}
}
state playanim
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
llStartAnimation(gAnimName);
llSleep(.75);
llPlaySound(gSoundName, 1);
}
}
