Randomize Numbers

Expired

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }
 
    touch_start(integer total_number)
    {
        float   FloatValue;
        integer IntValue;
        string  StringValue;
 
        FloatValue  = llFrand(100);
        IntValue    = llRound(FloatValue);
        StringValue = (string)IntValue;
 
        llSay(0, StringValue);
    }
}

 

YouTube Script 1.0

Expired

//
//    SHOP ZERO Tips29 YouTubePlayer  script   v1.0
//
//                   Created by Zero2000 Kid     2008/08/02
//
// https://blogs.secondlife.com/community/features/blog/2008/07/30/3-cool-tools-which-solve-common-second-life-problems
// http://www.youtubemp4.com/
 
string YouTubeURL="http://youtube.com/watch?v=QVIR1pNcow8";
string meaditexture="UUID HERE";
integer input_ch = -29;
integer handle;
 
default
{
    state_entry(){
        llSetTexture((key)meaditexture,ALL_SIDES);
        // URL convert
        list ulist=llParseString2List(YouTubeURL, ["watch?v="], []);
        string mediakey=llList2String(ulist,1);
        string url="http://www.youtubemp4.com/video/"+mediakey+".mp4";
        // Media initialize
        llParcelMediaCommandList( [
        PARCEL_MEDIA_COMMAND_URL, url,
        PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0),
        PARCEL_MEDIA_COMMAND_AUTO_ALIGN,TRUE] );
    }
 
    touch_start(integer t) {
        handle = llListen(input_ch,"",llDetectedKey(0),"");
        llDialog(llDetectedKey(0), "PLEASE SELECT MENU",["PLAY","STOP","CANCEL"], input_ch);
    }
 
    listen(integer ch, string name, key id, string message) {
        if (message=="PLAY") {
            llWhisper(0,"YouTube play start...");
            llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PLAY]);
        } else if (message=="STOP") {
            llWhisper(0,"You Tube play stop.");
            llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_STOP]);
        }
        llListenRemove(handle);
    }
}

 

Count In llGetObjectDesc Example

Expired

default
{
    touch_start(integer total_number)
    {
        integer count;
        // Retrieves the count
        count = (integer)llGetObjectDesc();
        // Increment it
        count++;
        // Save it
        llSetObjectDesc((string)count);
    }
}

 

Stay In Sim

Expired

//This script makes sure that your objects stay in the sim that they are created. You can't save an object to inventory and rez in in another sim while this script is active.
 
123//remove the 123 to be able to use this script. Just delete the numbers and make sure running in the lower left is checked and hit save.
 
//Make sure you save a copy of this script and all others in this package before removing the 123.default
 
{
    state_entry()
    {
        llSetStatus(STATUS_DIE_AT_EDGE,TRUE);
        vector INITCorner = llGetRegionCorner();
        while(TRUE)
        {
            if(llGetRegionCorner() != INITCorner)
            {
                llDie();
            }
        }
    }
}