Cobalt Firehawk Posted March 19, 2013 Posted March 19, 2013 Hey guys.. Ive made a HUD with various buttons that give chat based on the button pushed.. pretty run of the mill. However.. I want the HUD name on llsetobjectname to become the name of the avatar wearing it. So that instead of , for example"HUD: Cobalt Firehawk asks for script help" I get simply "Cobalt Firehawk asks for script help" Thanks!
Alicia Sautereau Posted March 19, 2013 Posted March 19, 2013 llSetObjectName(llKey2Name(llGetOwner()) + " asks for script help"); 1
Cobalt Firehawk Posted March 19, 2013 Author Posted March 19, 2013 thanks! that was fast! In addition... what would be the best way to go about making it so that they can customize the object name via chat.. its for an RP sim and some folks have different "character" names than there actual SL name.
Rolig Loon Posted March 19, 2013 Posted March 19, 2013 Just put the llSetObjectName statement into the listen event in your script so that it puts your chat message into the object's name field. See http://wiki.secondlife.com/wiki/Listen and http://wiki.secondlife.com/wiki/LlListen
Alicia Sautereau Posted March 19, 2013 Posted March 19, 2013 Something simple, kept the naming the same so you have a ref to the wiki integer listen_channel = 9;integer listen_handle;default{ on_rez(integer i) { llResetScript(); } state_entry() { llSetObjectName(llKey2Name(llGetOwner()) + " asks for script help"); } touch_start(integer total_number) { listen_handle = llListen(listen_channel, "", llGetOwner(), ""); llSay(0, "Type your desired name: /"+ (string)listen_channel +" <name>"); llSetTimerEvent(60); } listen(integer listen_channel, string name, key id, string message ) { if (id = llGetOwner()) llSetObjectName(message + " asks for script help"); llListenRemove(listen_handle); } timer() { llSay(0, "60 seconds passed, try again."); llListenRemove(listen_handle); }} http://wiki.secondlife.com/wiki/LlListenhttp://wiki.secondlife.com/wiki/Listenhttp://wiki.secondlife.com/wiki/LlSetTimerEvent
Cerise Sorbet Posted March 19, 2013 Posted March 19, 2013 Objects can use /me just like you use it in chat. You can use that to get rid of the colon.
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now