Second Life Copybot
Avatar Title Changer - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: Avatar Augmentation Scripts (https://secondlifecopybot.com/forum-51.html)
+----- Thread: Avatar Title Changer (/thread-1233.html)



Avatar Title Changer - YoungMoney - 03-04-2013

// Changes avatar hovering title on command in local chat, starting with /change. Put the script in a small box and texture the box with a 100% transparent texture. Attach the box to your upper body (head or schoulder).



Code:
// Avatar Title Changer
// author: unknown




string default_text = "Type /change to change the hovering text!";
string text;
list colors =

[<1.0,1.0,1.0>,<0.5,0.5,0.5>,<1,0,0.0,0.0>,<0.0,1.0,0.0>,<0.0,0.0,1.0>,<1.0,1.0,0.0>,
<1.0,0.0,1.0>,<0.0,1.0,1.0>];

default
{
    state_entry()
    {
        text = default_text;
        llListen(0, "", NULL_KEY, "");
        llSetText(text, <0,1,0>, 1.5);
        llSetTimerEvent(0.5);    
    }
    
    on_rez(integer start_param)
    {
        text = default_text;
        llSetText(text, <0,1,0>, 1.5);
    }
    
    listen(integer channel, string name, key id, string message)
    {
        if (llToLower(llGetSubString(message, 0, 6)) == "/change" && id == llGetOwner())
        {
            text = llDeleteSubString(message, 0, 6);
            llSetText(text, <0,1,0>, 1.5);
        }
    }
    
    timer()
    {
        integer random = llFloor(llFrand(llGetListLength(colors)));
        llSetText(text, llList2Vector(colors,random), 1.5);
    }
}