Jump to content
madysonfaye

Need help with Simple Script! I'm so CLOSE!!!

Recommended Posts

Okie, so i found a nose kiss script i wanted to use for my Toddleedoo and edited it a bit.  My problem was originally, that it didn't display the display name for the person who clicked it, but showed display name for the owner (me).  So i edited it a bit and i'm so close!  Now it shows the Display name for both clicker and owner.  But it has this ":" in front it which I think is the object name...  Originally the snippet that read: " llSay(0, llGetDisplayName(llDetectedKey(0)) + "kisses " + owner + "'s nose. ");" read " llSay(0, "/me kisses " + owner + "'s nose."); " and I think that's the problem...?  Can anyone help me with removing the ":"?  Thank you so much in advanced!  Here is my current lsl (it might be kind of messy lol):

default
{
   state_entry()
   {
       llPreloadSound("KISS SOUND HERE");
   }
   on_rez(integer start_param)
   {
       llResetScript();
   }
   touch_start(integer total_number)
   {
       integer i;
       for (i = 0;i < total_number;i += 1)
       {
       llPlaySound("KISS SOUND HERE", 0.7);
       string origName = llGetObjectName();
       string owner;
       owner = llGetDisplayName( llGetOwner() );
       owner = llList2String( llParseString2List( owner, [" "], [] ), 0 );
       string avName;
       avName = " ";;
       avName = llList2String( llParseString2List( avName, [" "], [] ), 0 );
       llSetObjectName( avName );
       llSay(0, llGetDisplayName(llDetectedKey(0)) + "kisses " + owner + "'s nose.");
       llSetObjectName( origName );
       }
   }
}

 

Share this post


Link to post
Share on other sites

Hello :) thanks for fast reply!  I got it working (i mistyped it at first and was having trouble with detectedkey) but now it puts /me in front of the display name.  Maybe i'm doing something wrong haha

 

EDIT:  OMG it worked!!!  I had to put a space behidn the /me!  

FINAL CODE:

default
{
   state_entry()
   {
       llPreloadSound("SOUND HERE");
   }
   on_rez(integer start_param)
   {
       llResetScript();
   }
   touch_start(integer total_number)
   {
       integer i;
       for (i = 0;i < total_number;i += 1)
       {
       llPlaySound("SOUND HERE", 0.7);
       string origName = llGetObjectName();
       string owner;
       owner = llGetDisplayName(llDetectedKey(0));
       owner = llList2String( llParseString2List( owner, [" "], [] ), 0 );
       string avName;
       avName = " ";;
       avName = llList2String( llParseString2List( avName, [" "], [] ), 0 );
       llSetObjectName( avName );
       llSay(0, "/me "+ llGetDisplayName(llDetectedKey(0)) +  "kisses " + owner + "'s nose. ");
       llSetObjectName( origName );
       }
   }
}

 

Thanks so much @Ruthven Willenov

Edited by madysonfaye
  • Like 1

Share this post


Link to post
Share on other sites

I think this is what you were trying to do:
 

   touch_start(integer total_number) {
       integer i;
       for (i = 0;i < total_number;i += 1) {
           llPlaySound("SOUND HERE", 0.7);
           string origName = llGetObjectName();
           string owner = llList2String( llParseString2List( llGetDisplayName(llDetectedKey(0)), [" "], [] ), 0 );
           string avName = llList2String( llParseString2List( llGetDisplayName(llDetectedKey(0)), [" "], [] ), 0 );
           llSetObjectName(avName);
           llSay( 0, "/me " +  "kisses " + owner + "'s nose. ");
           llSetObjectName( origName );
       }

 

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, madysonfaye said:

EDIT:  OMG it worked!!!  I had to put a space behidn the /me!  

Congratulations! Since you are using the display name, you will sooner or later realize that some display names will not work. THe reason is that objects cannot be named to special characters. Here is a script solution that you can use to circumvent this limitation:

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...