Touchbox

De DigiWiki.

// OPEN SOURCE!! DO NOT RESELL!!
// © 2008 by FoxSan Yosuke
 
integer second;
vector startPosition;
 
default
{
    state_entry()
    {
        llSetText("I am just a box.\nBut whatever you do, do NOT touch me! D:", <1.0, 1.0, 1.0>, 1.5);
        startPosition = llGetPos();
    }
 
    on_rez(integer start_param)
    {
        llResetScript();
    }
 
    touch_start(integer total_number)
    {
        llSay(PUBLIC_CHANNEL, "OMG! You touched me! D: RAEP! HEEELP! O.o");
        llPlaySound("Sound1", 1.0);
        llPlaySound("Sound1", 1.0);
        llSetTimerEvent(0.5);
    }
 
    timer()
    {
        second++;
        float X_dis = llFrand(10.0);
        float Y_dis = llFrand(10.0);
        float Z_dis = llFrand(10.0);
        vector displacement = < X_dis, Y_dis, Z_dis >;
        vector newPosition = startPosition + displacement;
        llSetPos(newPosition);
 
        if (second > 15)
        {
            while (llVecDist( llGetPos(), startPosition) > 0.001)
            {
                llSetPos( startPosition );
            }
 
            llSay(PUBLIC_CHANNEL, "I feel SO violated! ._.");
            llPlaySound("Sound2", 1.0);
            llResetScript();
        }
    }
}
Outils personnels
  • Cette page a été consultée 927 fois.
donate
Google Ads