Jump to content

A walker that only starts if you walk for 5 seconds


Leo1452
 Share

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

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

Recommended Posts

I find that the walker scripts people are sharing around are too sensitive. You TP on someone's head and it starts playing, which isn't great for me because it already has a TP sound. I've tried adding llSleep() but that just causes the sound to come in late. I wanna prevent the following basic walker from playing unless I walk for 5 seconds.

string Snd = "Sleepwalk";
integer For = AGENT_WALKING;
default
{
    state_entry()
    {
        llPreloadSound(Snd);
        state entry;
    }
}
state entry
{
    state_entry()
    {
        llStopSound();
        @D;
        if (llGetAgentInfo(llGetOwner()) & For)
        {
            llSleep(2.0);
            state walking;
        }
        jump D;
    }
}
state walking
{
    state_entry()
    {
        llLoopSound(Snd,.0);
        float alpha = 0.0;
        @DD;
        llAdjustSoundVolume(alpha);
        alpha +=.1;
        if(alpha >= 1.0){jump D;}
        jump DD;
        @D;
        if (!(llGetAgentInfo(llGetOwner()) & For))
        {
            float alpha = 1.0;
            @DXD;
            llAdjustSoundVolume(alpha);
            alpha -=.1;
            if(alpha < 0.0){jump DX;}
            jump DXD;
            @DX;
            state entry;
        }
        jump D;
    }
}

 

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...