Jump to content

Touch script not working?


Sven Nebula
 Share

You are about to reply to a thread that has been inactive for 2128 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Why isn't the touch script working? Please, I need help from a scripter ASAP. Here's the snippet:
 

integer setting;
float wait;
float rand;
default
{
    state_entry()
    {
        @blink;
        llSetText((string)setting, <1, 1, 1>, 1);
        if(setting == 0)
        {
            llOffsetTexture(0, 0.2, -1);
            llOffsetTexture(0, 0.4, -1);
            wait = 0;
            rand = llFrand(0.2) + 0.1;
            while(wait < rand)
            {
                wait = wait + 0.25;
                llOffsetTexture(0, 0.4, -1);
            }
            llOffsetTexture(0, 0.2, -1);
            llOffsetTexture(0, 0, -1);
            wait = 0;
            rand = llFrand(8.0);
            while(wait < rand)
            {
                wait = wait + 0.25;
                llOffsetTexture(0, 0, -1);
            }
        }
        if(setting == 1)
        {
            llOffsetTexture(0, 0, -1);
        }
        if(setting == 2)
        {
            llOffsetTexture(0, 0.4, -1);
        }
        if(setting == 3)
        {
            llOffsetTexture(0, -0.1, -1);
        }
        if(setting == 4)
        {
            llOffsetTexture(0, 0.2, -1);
        }
        jump blink;
    }
    
    touch(integer total_number)
    {
        if(setting == 4)
        {
            setting = 0;
        }
        else
        {
            setting = setting + 1;
        }
        llOwnerSay((string)setting);
    }
}

 

Edited by JondiDitto
Link to comment
Share on other sites

13 minutes ago, animats said:

See how to use a Timer.

Basic concept in LSL: you do a little something to change your objects and exit. The world simulator then does lots of other things. Then you get another event, and another chance to change your objects a little. This repeats.

There are scripting classes available at Oxbridge Caledon.

Alright, I will check that out soon. If I run into any problems, I'll continue here.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2128 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...