I'm a beginner scripting but had a basic goal.
I want this sound to repeat in a loop, run around 60 seconds then stop.
Its an Alert klaxon for a Battlestar
I created aprim box and stuck the sound inside.
then a script to play it.
Here are my tries:
default
{
state_entry()
{
llSay(0, "Action Stations! Action Stations! Set Conition 1 throughout the ship!"
;}
touch_start(integer total_number)
{
llSay(0, "Action Stations! Action Stations! Set Conition 1 throughout the ship!"
;llSay(0, "All pilots report to the launch bay."
;integer x = 0;
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
}
}
plays the sound once and exits.
For loop:
default
{
state_entry()
{
}
touch_start(integer total_number)
{
integer x = 0;
for (x = 0; x < 10; x++)
{
llPlaySound(llGetInventoryName(INVENTORY_SOUND, 0), 1);
}
}
}
I put a write statement with a number in the for loop and it executes 10 times and then the sound plays.
Have mercy on me, I'm learning scripting the hard way.
Can someone tell me how to do this so my script controls how long the sound loops.



