Something like the following could be used (methinks it would also work in a HUD):
Code: Select all
//note that you need to touch the prim again to restart the timer
float minutes = 0.5;//edit to change duration
startTimer()
{
llSetTimerEvent(minutes*60);
llSetText("Active", <0,1,0>, 1);
llSetColor(<0,1,0>, ALL_SIDES);
}
default
{
state_entry()
{
llSetText("Touch to start", <1,1,1>, 1);
}
changed(integer c)
{
if (c & CHANGED_REGION_START)
{
llSetText("Touch to start", <1,1,1>, 1);
}
}
touch_start(integer n)
{
startTimer();
}
timer()
{
llPlaySound("intermittent alarm2", 1.0);
llSetColor(<1,0,0>, ALL_SIDES);
//comment out to make recurrent
llSetText("Inactive", <1,0,0>, 1);
//comment out to make recurrent
llSetTimerEvent(0.0);
}
}
PS: You need to have a sound called "intermittent alarm2" (which I recorded from a fire alarm drill). Note that HUD sounds are only played to the person wearing the HUD. You need to touch the prim to start/restart the timer. Change the value of minutes to alter the interval.
PPS: to make a HUD, edit the prim and resize it to 0.2x0.2x0.2 m, take it into inventory and then rightclick, attach to HUD (I used Centre 2) and then move the hud to a convenient location and resize if desired. Close the Edit dialog and you are good to go. If anyone wants the alarm sound, please let me know (Graham Mills_2). This is a pro tem solution; ace scripters feel free to produce something more elegant/functional.