Hi
I have a script which calls a second script on an event.
The second script is a countdown timer.
If the event on the first (master) script happens again and the link message is resent, I need the countdown timer on the second script to restart. This is not happening, as it's waiting for the for loop to finish first.
Any ideas?
Here is the timer in the second script:
integer i;
string str;
default
{
link_message(integer sender_num, integer num, string str, key id)
{
for (i=180; i > 0; i--)
{
llSetText("timer started "+ (string)i +" seconds left", <0, 1.0, 0>, 1);
llSleep(1.0);
}
}
}
The script will send a single string variable (once working properly) to the second script.
Here is the call from the first script:
llMessageLinked(LINK_SET, 0, (string)total, NULL_KEY);
All I need to happen is when the event in the main script is triggerd (it's using an IF condition), this script resets and starts the countdown again with the new variable content, instead of waiting for the for loop to finish first.
I'm sure it must be simple, but after several hours of banging my head against the wall, I need ideas (and more coffee!).
Any help would be much appreciated.
Gomez