osgrid.org
https://forums.osgrid.org/

multiprim color changer
https://forums.osgrid.org/viewtopic.php?f=5&t=197
Page 1 of 1

Author:  Really Xcited [ Fri Jul 18, 2008 7:58 pm ]
Post subject:  multiprim color changer

///master colorchanger put in primary prim
/// script by: Fred Extraordinaire

key owner;
// put the name of ur object below or whatever u want the command to
// be for color changeing
string objectname = " your objects name here";

default
{
on_rez(integer start)
{
owner = llGetOwner();
llMessageLinked(LINK_SET, 0, "IM", "say '" + objectname + "' then the color you want to change to.");
}
state_entry()
{
llListen(0,"",owner,"");
llListen(1,"",owner,"");

}
listen(integer channel,string name, key id, string message)
{
if(id == owner)

if(message == objectname + " green")
{
llMessageLinked(LINK_SET, 0, "green", "");
}
if (message == objectname + " yellow")
{
llMessageLinked(LINK_SET, 0, "yellow", "");
}
if (message == objectname + " red")
{
llMessageLinked(LINK_SET, 0, "red", "");
}
if (message == objectname + " blue")
{
llMessageLinked(LINK_SET, 0, "blue", "");
}
if (message == objectname + " grey")
{
llMessageLinked(LINK_SET, 0, "gray", "");
}
if (message == objectname + " orange")
{
llMessageLinked(LINK_SET, 0, "orange", "");
}
}
}

//////slave colorchange (put in any prim you want to change colors
default
{
link_message(integer sender, integer num, string str, key id)
{
if (str == "green")
{
llSetColor(<0.500,1.0,0.500>, ALL_SIDES);

}
if (str == "yellow")
{
llSetColor(<1,1,0.5>, ALL_SIDES);

}
if (str == "red")
{
llSetColor(<0.500,0.200,0.200>, ALL_SIDES);

}
if (str == "blue")
{
llSetColor(<0.500,1.0,1.0>, ALL_SIDES);

}
if (str == "gray")
{
llSetColor(<0.200,0.200,0.200>, ALL_SIDES);

}
if (str == "orange")
{
llSetColor(<1.0,0.500,0.200>, ALL_SIDES);

}
if (str == "pink")
{
llSetColor(<1.0,0.0,0.50196>, ALL_SIDES);

}

}
}

//////owner IM script (yes this was written before llOwnerSay deal with it)
default
{
link_message(integer sender, integer num, string str, key id)
{
if (str == "IM") {
llInstantMessage(llGetOwner(), id);
}
}
}

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/