Scrolling Floating Text

Type: 
LSL Script

Place this script in a prim and you'll see the floating text (hovertext) above it scrolling by. There are settings at the top of the script for changing the maximum characters to show, the speed, etc.

Source Code: 
integer maxCR = 15; // max. chars. to show
integer scrCR = 1; // scrolling chars.
float speed = 0.3; // scrolling speed.
float alpha = 1.0; // text alpha
vector color = <0.9, 1.0, 0.2>; // text color
string zin = "Check this scrolling text."; // text

// ---   stop editing settings here ;-)   ---

integer lng;
integer ofs = 0;

setToDef(){
    integer i; string ins="";
    for(i=1; i<maxCR; i++){ins+=" ";}
    zin=ins+zin;
    lng = llStringLength(zin);
    llSetText("", color, alpha);
    llSetTimerEvent(speed);
}

default
{
    state_entry(){
        setToDef();
    }
    timer(){
        integer end = ofs+maxCR;
        if(end>lng) {end=lng; }
        string sw = llGetSubString(zin, ofs, end);
        ofs += scrCR;
        if(ofs > lng){ ofs=0; }
        llSetText(sw, color, alpha);
    }
}