|
Chronicles Silverspar
Registered User
Join date: 1 Mar 2008
Posts: 2
|
04-22-2008 03:10
how do i display the person clicking an objects name and the object owners?
and i was also wondering how to just display their first name.
i am new to lsl but have some general scripting knowledge, and want to make an object for my girlfriend.
please any help is appreciated...
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
04-22-2008 06:28
You can display it in the hovertext. Try this:
default{
touch_start(integer detected_num){
// To display the first names only
// Owner's name
list tmp = llParseString2List(llKey2Name(llGetOwner()), [" "], []);
string firstname1 = llList2String(tmp, 0);
// Klicker's name
tmp = llParseString2List(llKey2Name(llDetectedKey(0)), [" "], []);
string firstname2 = llList2String(tmp, 0);
llSetText(firstname1 + " and " + firstname2 + " are highly in love :)", <1.0, 1.0, 1.0>, 1.0);
}
}
HTH 
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-22-2008 07:00
keep in mind that the "avatar" must be in the same sim, as the object, otherwise llKey2Name will fail.
So here's the trick. Have the script save the object owner's name on state entry... And only set the clicker's name on ttouch.
And you can use llDetectedName(0) instead of llKey2Name(llDetectedKey(0))
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
04-22-2008 07:40
I guess I'll have to put a copy of the wiki on my magazine-rack in the bathroom, too 
|
|
Chronicles Silverspar
Registered User
Join date: 1 Mar 2008
Posts: 2
|
04-22-2008 13:17
thank you very much, i was planning on having it be an object she wore so i shouldnt have to worry about us being in different sims too much, you've been alot of help. 
|