User:Myst Leissa

From Second Life Wiki
Revision as of 20:26, 23 July 2013 by Myst Leissa (talk | contribs) (Created page with "{{wikify}} == SayAsAvatar Snippet == This Function will execute the LSL Command to create a line of text in a Given Avatar's Display Name by Key. (ie instead of llSay(0,"/me "+l…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Wikification Requested

The Wikification of this article has been requested. In case you're familiar with Wiki editing, please edit this article in a way that it looks nice and remove this template afterwards.


SayAsAvatar Snippet

This Function will execute the LSL Command to create a line of text in a Given Avatar's Display Name by Key. (ie instead of llSay(0,"/me "+llGetDisplayName(llDetectedKey(0)+" hides") Which will produce the emote of the "<object name>: <display_name> Hides" You Can Instead use this snippet to cut off <object name> and replace it with the llGetDisplayName(llDetectedKey(0))

<lsl> AvTalk(string msg, key id) {

 string org_name = llGetObjectName();
 llSetObjectName(llGetDisplayName(id));
 llSay(0,msg);
 llSetObjectName(org_name);

} </lsl>

An Example of how to use this is:

<lsl> AvTalk(string msg, key id) {

string org_name = llGetObjectName();
llSetObjectName(llGetDisplayName(id));
llSay(0,msg);
llSetObjectName(org_name);

} string text_string; default {

state_entry() {
  llListen(1,"",llGetOwner(),"");
  llOwnerSay("Ready To Test (type /1<message> to set message the person who touches will say");
}
listen(integer chan, string name, key id, string msg) {
 text_string = msg;
 llOwnerSay("Next Person to touch this object will say "+text_string);
}
touch_start(integer touch_number) {
 if(llStringLength(text_string)>=1) AvTalk(text_string,llDetectedKey(0));
 else AvTalk("Nothing has been set",llDetectedKey(0));
}

}</lsl>