Jump to content

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


madysonfaye
 Share

You are about to reply to a thread that has been inactive for 1728 days.

Please take a moment to consider if this thread is worth bumping.

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 );
       }
   }
}

 

Link to comment
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
Link to comment
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
Link to comment
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:

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1728 days.

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
 Share

×
×
  • Create New...