Error403Forbidden Posted July 2, 2020 Share Posted July 2, 2020 Hello! I am trying to figure out how to make a Script that, when a single prim is touched, it will publicly say something and includes the person name who touched it. Example: Avatar touches prim. Prim emits publicly, "Johndoe touced the box" Thanks in Advance! Link to comment Share on other sites More sharing options...
Emma Krokus Posted July 2, 2020 Share Posted July 2, 2020 default { touch_start(integer start_param) { llSay(0,"Hello, your display name is " + llGetDisplayName(llDetectedKey(0)) + " and your user name is " + llDetectedName(0) + "."); llSay(0, llGetDisplayName(llDetectedKey(0)) + " touched the box"); llSay(0, llDetectedName(0) + " touched the box."); } } Link to comment Share on other sites More sharing options...
Error403Forbidden Posted July 2, 2020 Author Share Posted July 2, 2020 35 minutes ago, Emma Krokus said: default { touch_start(integer start_param) { llSay(0,"Hello, your display name is " + llGetDisplayName(llDetectedKey(0)) + " and your user name is " + llDetectedName(0) + "."); llSay(0, llGetDisplayName(llDetectedKey(0)) + " touched the box"); llSay(0, llDetectedName(0) + " touched the box."); } } Thank you a ton! 2 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted July 2, 2020 Share Posted July 2, 2020 32 minutes ago, Emma Krokus said: default { touch_start(integer start_param) { llSay(0,"Hello, your display name is " + llGetDisplayName(llDetectedKey(0)) + " and your user name is " + llDetectedName(0) + "."); llSay(0, llGetDisplayName(llDetectedKey(0)) + " touched the box"); llSay(0, llDetectedName(0) + " touched the box."); } } Not quite, I think. If you want the usename, then use llGetUsername(llDetectedKey(0)), I think. llDetectedName will give your full name (Innula Zenovka) if you have a last name, otherwise Joe123 Resident. 1 Link to comment Share on other sites More sharing options...
Error403Forbidden Posted July 2, 2020 Author Share Posted July 2, 2020 2 minutes ago, Innula Zenovka said: Not quite, I think. If you want the usename, then use llGetUsername(llDetectedKey(0)), I think. llDetectedName will give your full name (Innula Zenovka) if you have a last name, otherwise Joe123 Resident. It worked 1 Link to comment Share on other sites More sharing options...
Kyrah Abattoir Posted July 2, 2020 Share Posted July 2, 2020 Additionally you can use the special viewer URI namespace: llSay(0, "secondlife:///app/agent/" + (string)llDetectedKey(0) + "/about touched the box"); 2 2 Link to comment Share on other sites More sharing options...
Emma Krokus Posted July 2, 2020 Share Posted July 2, 2020 Thank you, Innula and Kyrah - I appreciate your explanations and additions very much. I will experiment with those. Emma Link to comment Share on other sites More sharing options...
Emma Krokus Posted July 2, 2020 Share Posted July 2, 2020 7 hours ago, Kyrah Abattoir said: Additionally you can use the special viewer URI namespace: llSay(0, "secondlife:///app/agent/" + (string)llDetectedKey(0) + "/about touched the box"); Oh I like to get a clickable name - thank you ! Emma 1 Link to comment Share on other sites More sharing options...
Oz Linden Posted July 2, 2020 Share Posted July 2, 2020 There's no reason to be calling llDetectedKey and llDetectedName more than once each: default { touch_start(integer start_param) { key avatar = llDetectedKey(0); string name = llDetectedName(0); llSay(0,"Hello, your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + "."); llSay(0, llGetDisplayName(avatar) + " touched the box."); llSay(0, name + " touched the box."); } } 5 1 Link to comment Share on other sites More sharing options...
Bugs Larnia Posted July 12, 2020 Share Posted July 12, 2020 If you really want to be fancy (not that scripters would *ever* do that 😁), you can also address people with their first names only: default { touch_start(integer start_param) { key avatar = llDetectedKey(0); string name = llDetectedName(0); string firstName = llList2String(llParseString2List(name, [" "], []), 0); llSay(0,"Hello, " + firstName + "! Your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + "."); llSay(0, llGetDisplayName(avatar) + " touched the box."); llSay(0, firstName + " touched the box."); } } 1 Link to comment Share on other sites More sharing options...
Error403Forbidden Posted July 24, 2020 Author Share Posted July 24, 2020 On 7/12/2020 at 11:57 AM, Bugs Larnia said: If you really want to be fancy (not that scripters would *ever* do that 😁), you can also address people with their first names only: default { touch_start(integer start_param) { key avatar = llDetectedKey(0); string name = llDetectedName(0); string firstName = llList2String(llParseString2List(name, [" "], []), 0); llSay(0,"Hello, " + firstName + "! Your display name is " + llGetDisplayName(avatar) + " and your user name is " + name + "."); llSay(0, llGetDisplayName(avatar) + " touched the box."); llSay(0, firstName + " touched the box."); } } Oh i like that! 1 Link to comment Share on other sites More sharing options...
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