Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with PERMISSION_ATTACH problem

Amara Twilight
Registered User
Join date: 16 Feb 2004
Posts: 47
07-26-2008 05:44
Hi there everyone!

I have a free script for removing a prim on touch via dialog menu, but when i test it i get the script error:

Script trying to detach from agent but PERMISSION_ATTACH permission not set!

I see the permission_attach in the script but it doesn't seem to be working and I have no idea why :/

Here is the script:

CODE

// Constants
integer perm;
integer intListenChannel = 2938;
string strLandmarkName = "Put your Landmark Info Here";

string strButtonsUser = "";
list lstButtonsUser = ["Landmark", "Pull", "Rip", "Touch"];

// Variables
list lstBanList = ["Jc Davids", "ZigglyAnn Qinan", "Dragos Zoah"];
integer isOn = TRUE;
integer intState = 0; // 0=idle; 1=user clicked; 2=permission; 3=ban; 4=owner clicked
string strCurrentSelection = "";
string strCurrentUserName;
key keyCurrentUser;

showDialogUser(key _av)
{
intState = 1;
llDialog(_av, "Select one option: ", lstButtonsUser, intListenChannel);
}

showDialogPermission()
{
intState = 2;
llDialog(llGetOwner(), strCurrentUserName + " is trying to interact with your skirt, do you want to permit this?", ["yes", "no"], intListenChannel);
}

showDialogBan()
{
intState = 3;
llDialog(llGetOwner(), "Do you want to ban " + strCurrentUserName + " from clicking your skirt?", ["yes", "no"], intListenChannel);
}

showDialogOwner()
{
intState = 4;
llDialog(llGetOwner(), "What do you want to do?\n", ["Landmark", "Reset list", "Say list", "Pull", "Rip", "Touch"], intListenChannel);
}

clear()
{
strCurrentSelection = "";
strCurrentUserName = "";
keyCurrentUser = NULL_KEY;
intState = 0;
}

default
{
state_entry()
{
llListen(intListenChannel, "", "", "");
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}

attach(key _id)
{
if (_id != NULL_KEY)
{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}
}

listen(integer _ch, string _nm, key _id, string _msg)
{
if (intState == 1) // if user clicked
{
if (_msg == "Landmark")
{
llGiveInventory(_id, strLandmarkName);
} else if (_msg == "Pull")
{
strCurrentSelection = "Pull";
keyCurrentUser = _id;
strCurrentUserName = llKey2Name(keyCurrentUser);

// Change this text to what you want to happen on button 1
llSay(0, strCurrentUserName + " does a step forward and pulls on " + llKey2Name(llGetOwner()) + "'s skirt watching it slip to the ground as her sleek slender body is uncovered");

showDialogPermission();
} else if (_msg == "Rip")
{
strCurrentSelection = "Rip";
keyCurrentUser = _id;
strCurrentUserName = llKey2Name(keyCurrentUser);

// Change this text to what you want to happen on button 2
llSay(0, strCurrentUserName + " grabs " + llKey2Name(llGetOwner()) + "'s skirt and gives it a good rip you won't be needing this anymore!!");

showDialogPermission();
} else if (_msg == "Touch")
{
strCurrentSelection = "Touch";
keyCurrentUser = _id;
strCurrentUserName = llKey2Name(keyCurrentUser);

// Change this text to what you want to happen on button 3
llSay(0, strCurrentUserName + " touches " + llKey2Name(llGetOwner()) + "'s skirt and feels the softness of the lace thinking of how her skin must feel");

showDialogPermission();
}
} else if (intState == 2) // owner has to give permission
{
if (_msg == "no")
{
llSay(0, llKey2Name(llGetOwner()) + " slaps " + strCurrentUserName + " in the face leaving her tiny hand print in a redding welt as she screams!");
showDialogBan();
} else if (_msg == "yes")
{
if (strCurrentSelection == "Pull")
{
// Change this text to what you want to happen on button 1
llSay(0, llKey2Name(llGetOwner()) + "'s skirt drops to the floor");
clear();
llDetachFromAvatar(); // if you don't want the skirt to be taken off delete this line
} else if (strCurrentSelection == "Rip")
{
// Change this text to what you want to happen on button 2
llSay(0, llKey2Name(llGetOwner()) + "'s skirt gets ripped to shreds");
clear();
integer perm = llGetPermissions();
if (perm & PERMISSION_ATTACH)
llDetachFromAvatar(); // if you don't want the skirt to be taken off delete this line
else
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
} else if (strCurrentSelection == "Touch")
{
// Change this text to what you want to happen on button 3
llSay(0, llKey2Name(llGetOwner()) + "'s skirt feels really soft");
clear();
llDetachFromAvatar(); // if you don't want the skirt to be taken off delete this line
}
}
} else if (intState == 3) // owner denied, do you want to ban
{
if (_msg == "yes")
{
lstBanList += strCurrentUserName;
clear();
} else if (_msg == "no")
{
clear();
}
} else if (intState == 4) // owner clicked
{
if (_msg == "Landmark")
{
llGiveInventory(_id, strLandmarkName);
} else if (_msg == "Reset list")
{
lstBanList = [];
llOwnerSay("Ban list has been reset");
} else if (_msg == "Say list")
{
integer i;
llOwnerSay("These are the avatars that are banned:");
for (i = 0; i < llGetListLength(lstBanList); i++)
{
llOwnerSay(llList2String(lstBanList, i));
}
} else if (_msg == "Pull")
{
// Change this text to what you want to happen on button 1
llSay(0, llKey2Name(llGetOwner()) + " drops her skirt to the floor");
clear();
//integer perm = llGetPermissions();
//if (perm & PERMISSION_ATTACH)
llDetachFromAvatar(); // if you don't want the skirt to be taken off delete this line
//else
//llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
} else if (_msg == "Rip")
{
// Change this text to what you want to happen on button 2
llSay(0, llKey2Name(llGetOwner()) + " rips her skirt to shreds");
clear();
//integer perm = llGetPermissions();
//if (perm & PERMISSION_ATTACH)
llDetachFromAvatar(); // if you don't want the skirt to be taken off delete this line
} else if (_msg == "Touch")
{
// Change this text to what you want to happen on button 3
llSay(0, llKey2Name(llGetOwner()) + " feels her skirt, its soft!");
clear();
}
}
}

touch_start(integer _num)
{
if (llListFindList(lstBanList, ["Dragos Zoah"]) == -1)
llSay(0, (string)lstBanList);
else
llSay(0, "none");

if (llDetectedKey(0) == llGetOwner()) // if owner touches
{
showDialogOwner(); // show the dialog for the owner
} else
{
if (isOn == TRUE) // if the machine is on
{
keyCurrentUser = llDetectedKey(0);
if (llListFindList(lstBanList, [llDetectedName(0)]) == -1) // if user is not in banlist
{
showDialogUser(keyCurrentUser); // show the dialog to the user
}
//else llSay(0, "You're banned!");
}
}
}
}


if i uncomment the one in the state entry then the prim never asks permission at all but it is detached.

help! :)

Thank you
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
07-27-2008 01:33
Amara, i tested your script and it works correctly.. The reason you get an error must be because of sim-settings?
Have you tried to use the sript in different places?
btw-
There is a LOT of garbadge info in the script -landmark, banlists and the whut.. those could be shaved of whitout changing the functionality.


what a mmm.. ..good girl would use a script like that for .. mm.. thats a ..mysteri :)
_____________________
BR ab