Jump to content
You are about to reply to a thread that has been inactive for 117 days.

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

Recommended Posts

Posted (edited)

so I need some help with a script, I found it on market place and was labeled as free to use. I wanted to make something fun out of it but have ran into some problems. I know nothing about how to pronounce some of the meanings for the LSL language however I do know how to alter some keys to make things change.

after someone clicks the head patter it sends a message in local chat and says the following. 

[22:19:30] Snow Raven shouts: Oh My Gosh! Virtual High Five! xxsuicidalidolxx.candycane

is it possible to stop it from saying (Shouting)

is it possible to remove my name at the end of the local chat message and replace it with the person who clicked the patter?

the part thats causing this is below.

                                                                      (  THIS PART )  }
    touch_start(integer tnum) {
            ShoutAs(llGetDisplayName(llDetectedKey(0)),"Oh My Gosh! "+llGetUsername(llGetOwner()));
            pulse = TRUE; 
            DoPart();

                                                                             ( END )

 

 

key texture = "956c24c1-10e6-030d-fa1d-69b664c7885e";
integer headpats = 0;
integer pulse = FALSE;
ShoutAs(string name, string msg) {
    string oname = llGetObjectName();
    llSetObjectName(name);
    llShout(0,msg);
    llSetObjectName(oname);
}
SetStatus() {
    string text = "☪️ Pet Me If You Love Boobies! ☪\n";
    if(headpats>0) text += " Total Head Pats "+(string)headpats+" times\n It Will Make Me Smile!";
    llSetText(text,<0.6, 0.4, 1.0>,1);
}
DoSound() {
    llTriggerSound("29ef94bb-caf2-aac6-c68a-87e6f47f1041",0.5);
}
DoPart() {
    headpats++;
    DoSound();
    llParticleSystem( [
        PSYS_PART_FLAGS,       PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_INTERP_COLOR_MASK,
        PSYS_SRC_PATTERN,      PSYS_SRC_PATTERN_EXPLODE, 
        PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
        PSYS_PART_START_SCALE, <0.2,0.2,0.2>,
        PSYS_PART_START_ALPHA, 5.0,
        PSYS_PART_END_ALPHA, 0.0,
        PSYS_SRC_BURST_RATE,10.0,
        PSYS_SRC_BURST_PART_COUNT,21,
        PSYS_PART_END_COLOR, <1,1,1>,
        PSYS_PART_MAX_AGE,5,
        PSYS_SRC_TEXTURE,texture
    ] );
    llSetText("Yay A Boobie Lover!",<0.6, 0.4, 1.0>,1);
    llSetTimerEvent(3.0);
}
default
{
    state_entry() {
        llParticleSystem([]);
        SetStatus();
    }
    touch_start(integer tnum) {
            ShoutAs(llGetDisplayName(llDetectedKey(0)),"Oh My Gosh! "+llGetUsername(llGetOwner()));
            pulse = TRUE; 
            DoPart();
        
    }
    changed(integer change) {
        if(change & CHANGED_OWNER) llResetScript();
    }
    timer() {
        if(pulse) {
            pulse = FALSE;
            llSetTimerEvent(0.0);
            llParticleSystem([]);
            SetStatus();
        }
    }
}

Edited by xXSuicidalIdolXx Candycane
Fixed Title
  • Haha 1
Posted

so im a bit confused because when I replace that line for line 43 it comes up with error line 43,95 Syntax error. what does this mean? here is now what I have in the script

}
    touch_start(integer tnum) {
            ShoutAs(llSay(0,(llDetectedKey(0)),"Oh My Gosh! "+llGetUsername(llDetectedName(0)));;
            pulse = TRUE; 
            DoPart();

 

what am I now doing wrong?

  • Haha 1
Posted

Find this block of code, change the bolded underlined line

ShoutAs(string name, string msg) {
    string oname = llGetObjectName();
    llSetObjectName(name);
    llShout(0,msg);
    llSetObjectName(oname);
}

into

llSay(0, msg);

  • Like 1
Posted
9 minutes ago, Frionil Fang said:

Find this block of code, change the bolded underlined line

ShoutAs(string name, string msg) {
    string oname = llGetObjectName();
    llSetObjectName(name);
    llShout(0,msg);
    llSetObjectName(oname);
}

into

llSay(0, msg);

okay maybe I'm just missing something, I promise I'm following this word for word. I did what you said, replace IIShout with IISay. however [17:12:42] Snow Raven: Oh My Gosh! xxsuicidalidolxx.candycane. thats what I'm greeted with in local chat. my question. if my alt account pats my head, why is my username or display showing at the end of oh my gosh. the only thing I figured out is how to switch it from display name to username (is it possible to stop my username from appearing at the end of oh my gosh? or (is it possible when someone pats my head to have their username at the end of it? or (is it possible in the text above my head to have the name of the last person who patted my head?)

 

also Marvin above listed a line of code which now gives me errors. I tired to work it in many different ways but it refuses to save. I just dont understand why a simple head pat is throwing so many issues.. 

Posted (edited)

I finally got the script to work. if anyone in the future needs help with head patters leave them here, I have not seen very many places that have head patter help, thank you for those who helped me

Edited by xXSuicidalIdolXx Candycane
  • Like 1
  • Haha 1
Posted

I was gonna say, doubled semicolon, but you got it fixed, so you probably already knew that. I'm glad you got it working!

It'll all get way easier as you get used to it. Remember, every obstacle is but a baby step when you look back at it. ^-^

  • Thanks 1
You are about to reply to a thread that has been inactive for 117 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
×
×
  • Create New...