ive created a touch script that works 100% but the problem is it only works for me, if someone else clicks on something my characters wearing that has a touch script it doesnt work for them? been going over my code for a day and cant figure it out. did i do something wrong in my code? sorry if someone has already made a post on this when i searched i didnt see one. its gonna be a plugin for PA by caeil string configurationNotecardName = "config";
key notecardQueryId;
integer line;
string papart;
string partname;
string arousal;
string partnamea;
string paparta;
string arousala;
key target;
string tostring ;
key yourname;
string namea;
string nameo;
init()
{
// reset configuration values to default
papart = "noanim";
partname = "mysterious object";
arousal = "10";
// make sure the file exists and is a notecard
if(llGetInventoryType(configurationNotecardName) != INVENTORY_NOTECARD)
{
// notify owner of missing file
llOwnerSay("Missing inventory notecard: " + configurationNotecardName);
// don't do anything else
return;
}
// initialize to start reading from first line (which is 0)
line = 0;
notecardQueryId = llGetNotecardLine(configurationNotecardName, line);
}
processConfiguration(string data)
{
// if we are at the end of the file
if(data == EOF)
{
// notify the owner
llOwnerSay("We are done reading the configuration");
// notify what was read
llOwnerSay("The avatar papart is: " + papart);
llOwnerSay("The partname is: " + partname);
llOwnerSay("The arousal amount is: " + arousal);
// do not do anything else
return;
}
// if we are not working with a blank line
if(data != "")
{
// if the line does not begin with a comment
if(llSubStringIndex(data, "#") != 0)
{
// find first equal sign
integer i = llSubStringIndex(data, "=");
// if line contains equal sign
if(i != -1)
{
// get name of name/value pair
string name = llGetSubString(data, 0, i - 1);
// get value of name/value pair
string value = llGetSubString(data, i + 1, -1);
// trim name
list temp = llParseString2List(name, [" "], []);
name = llDumpList2String(temp, " ");
// make name lowercase (case insensitive)
name = llToLower(name);
// trim value
temp = llParseString2List(value, [" "], []);
value = llDumpList2String(temp, " ");
// name
if(name == "papart")
papart = value;
// color
else if(name == "partname")
partname = value;
else if(name == "arousal")
arousal = value;
// unknown name
else
llOwnerSay("Unknown configuration value: " + name + " on line " + (string)line);
}
// line does not contain equal sign
else
{
llOwnerSay("Configuration could not be read on line " + (string)line);
}
}
}
// read the next line
notecardQueryId = llGetNotecardLine(configurationNotecardName, ++line);
}
default
{
on_rez(integer start_param)
{
init();
}
changed(integer change)
{
if(change & (CHANGED_OWNER | CHANGED_INVENTORY))
init();
}
state_entry()
{
llSetTouchText("Boop!");
init();
}
dataserver(key request_id, string data)
{
if(request_id == notecardQueryId)
processConfiguration(data);
}
touch_start(integer total_number)
{
string partnamea = partname;
string paparta = papart;
string arousala = arousal;
key target = llDetectedKey(0);
string tostring = (string) target;
key yourname = llGetOwner();
string namea = llGetDisplayName(yourname);
string nameo = llGetDisplayName(target);
if (llDetectedKey(0) == llGetOwner()) {
llMessageLinked(LINK_SET,0,"arousalSetText|"+tostring+"|"+"1"+"|"+nameo+" is booping their "+partnamea,"");
llMessageLinked(LINK_SET,0,"caeilarousalup|"+tostring+"|"+arousala+""+paparta,"");
}
else {
llMessageLinked(LINK_SET,0,"arousalSetText|"+tostring+"|"+"1"+"|"+namea+" is having their "+partnamea+" booped by "+nameo,"");
llMessageLinked(LINK_SET,0,"caeilarousalup|"+tostring+"|"+arousala+""+paparta,"");
}
}
}