All pastes #605162 Raw Edit

pingpong

public text v1 · immutable
·published 2007-07-06 00:07 UTC
rendered paste body
float gap = 2.0;
integer isPing = false;

default
{
    state_entry()
    {
        // Activate the timer listener every 'gap' seconds
        llSetTimerEvent(gap);
    }

    timer()
    {
        rotation rot;
        if(isPing)
        {
            rot = llEuler2Rot(<90,45,270> * DEG_TO_RAD);
        }
        else
        {
            rot = llEuler2Rot(<90,30,270> * DEG_TO_RAD);
        }
        llSetRot(rot);
        isPing = !isPing; //switch the status
        llSetTimerEvent(gap); //reset the timer, as any time it took to rotate would be ignored
    }    
    
    touch_start(integer total_number) // it's a cat
    {
        llSay(0, "MEOWWz0r");
    }
}