Jump to content

Clickable script not dispalying toucher name in text


NikosFevara
 Share

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

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

Recommended Posts

Hey guys. Been working on this little PA script and im stuck at this point. Everything works except for displaying in the above avatar text who clicked it.
It's picking up the owner perfectly fine but not who's clicking it (I'm working on the bite option ATM) . Its probably something simple but any help is appreciated.

 

list buttons = ["Lick", "Rub", "Bite", "Suck On", "-"];
string dialogInfo = "\nHow do you want to tease them?.";
key avatar;
string OWNER;
string OWNERNAME;
string touchername;
key toucher;
integer dialogChannel;
integer listenHandle;

default
{
    state_entry()
    {
        dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );
        avatar = llKey2Name(OWNER = llGetOwner());
        OWNERNAME = llGetDisplayName(OWNER = llGetOwner());
    }
 
    touch_start(integer num_detected)
    {
        key toucher = llDetectedKey(0);
        string touchername = llGetDisplayName(toucher);
        llListenRemove(listenHandle);
        listenHandle = llListen(dialogChannel, "", toucher, "");
        llDialog(toucher, dialogInfo, buttons, dialogChannel);
        llSetTimerEvent(60.0);
    }
 
    listen(integer channel, string name, key id, string message)
    {
        if (message == "-")
        {
            llDialog(toucher, dialogInfo, buttons, dialogChannel);
            return;
        }
 
        llListenRemove(listenHandle);
        llSetTimerEvent(0);
 
        if (message == "Lick")
        {
            llMessageLinked(LINK_SET,0,"arousalClearText|"+OWNER, "");
            llMessageLinked(LINK_SET,0,"arousalSetText|"+OWNER+"|"+"1"+"| "+touchername+" Text Here   ", "");
            llMessageLinked(LINK_SET,0,"caeilarousalup|"+OWNER+"|35" + "|" , "");
        }
        else if (message == "Bite")
        {
            llMessageLinked(LINK_SET,0,"arousalClearText|"+OWNER, "");
            llMessageLinked(LINK_SET,0,"arousalSetText|"+OWNER+"|"+"2"+"| "+touchername+" text here "+OWNERNAME+" text here ", "");
            llMessageLinked(LINK_SET,0,"caeilarousalup|"+OWNER+"|75" + "|" , "");
            
        }
        else if (message == "Suck On")
        {
            //action
        }
        else if (message == "Rub")
        {   
            //action
        }
        else
        {
            //action
        }
    }
 
    timer()
    {
    //  stop timer
        llSetTimerEvent(0);
 
        llListenRemove(listenHandle);
    }
}

 

Link to comment
Share on other sites

37 minutes ago, Rolig Loon said:

You redefined the variable touchername in the touch_start event, creating a second, local variable with the same name as your global variable.  The global variable never collects the toucher's name because you never use it.

OMG thankyou, i knew it would be something as simple as that. Your help is greatly appreciated

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1885 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...