Don't click here unless you want to be banned.

LSL Wiki : LibrarySetTextOnce

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
I'm sick of people leaving their llSetText() scritps on objects just because they were too lazy to (or didn't know they could) remove them after the text was set. Plus, I'm always to lazy to remove my llSetText scripts from my objects. :)

This script will immediatly listen for the next thing spoken by the owner, then set the text to what was said, with the color based on which channel, then delete itself. I couldn't think of a faster way to do this. Simply drop the script on an object, say "/3 This is Red" and you're done.

I know this could be a lot more, but I like to keep things simple.

default
{
    state_entry()
    {
        llOwnerSay("Speak the text you want to hover over me");
        llOwnerSay("Preceed with /1 for White");
        llOwnerSay("Preceed with /2 for Black");
        llOwnerSay("Preceed with /3 for Red");
        llOwnerSay("Preceed with /4 for Green");
        llOwnerSay("Preceed with /5 for Blue");
        llOwnerSay("A single dash (-) will clear text");
        
        llListen(0, "", llGetOwner(), "");
        llListen(1, "", llGetOwner(), "");
        llListen(2, "", llGetOwner(), "");
        llListen(3, "", llGetOwner(), "");
        llListen(4, "", llGetOwner(), "");
        llListen(5, "", llGetOwner(), "");
        
    }
    
    listen( integer channel, string name, key id, string message )
    {
        vector vColor = <0.5, 0.5, 0.5>;
        if (channel==1) {
            vColor = <1,1,1>;
        }else 
        if (channel==2) {
            vColor = <0,0,0>;
        }else 
        if (channel==3) {
            vColor = <1,0,0>;
        }else 
        if (channel==4) {
            vColor = <0,1,0>;
        }else 
        if (channel==5) {
            vColor = <0,0,1>;
        }
        if (message=="-") {
            llSetText("", <0,0,0>, 1);
        }else{
            llSetText(message, vColor, 1);
        }
        llRemoveInventory(llGetScriptName()); // delete this script
    }
}


ScriptLibrary
There is no comment on this page. [Display comments/form]