Jump to content
Sign in to follow this  
Cindy Kraai

Stop llGetUnixTime when it reach a certain float

Recommended Posts

integer Count;
default
{
    state_entry()
    {
        Count = llGetUnixTime();
        if(Count < 10){
            llSetTimerEvent(0);
            }
        else 
        llSetTimerEvent(0.1);
    }
 
    timer()
    {
        llSetText((string)(llGetUnixTime() - Count) + " Seconds!\n\n ", <1,0,0>, 1.0);
        
    }
}

im not really sure how it works but the idea is as soon as the script runs it will start counting via text and when it reaches a certain number it will stop. Can someone help me with this pls, thanks in advance

Share this post


Link to post
Share on other sites

Looks like your trying to count up to 10 seconds

In which case I would use llResetTime and LLGetTime

 

integer Count;default{    state_entry()    {        llResetTime();        llSetTimerEvent(0.1);    }     timer()    {        Count = (integer)llGetTime();		if ( Count <= 10)		{			llSetText((string)Count + " Seconds!\n\n ", <1,0,0>, 1.0);		}		else		{			llSetTimerEvent(0.0);		}            }}

(Edited to fix syntax errors and typos)

 

 

  • Like 1

Share this post


Link to post
Share on other sites

a quick request if it's not too much, can this also be in reverse, like it will count from 10 to 0 then as it goes 0 llSetTimerEvent(0)?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...