Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

can't unlink on rez

canis Oh
Registered User
Join date: 30 Mar 2007
Posts: 33
08-01-2008 18:47
If I put this script into several prims; link them; take into inventory; and rez from the inventory, I expect several questions asking for unlink permission at which each prim would unlink itself. Though I get the requests, the prims seem to remain linked. How so?

default {
on_rez(integer param) {
if (llGetLinkNumber())
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
}

run_time_permissions(integer permissions) {
if (permissions & PERMISSION_CHANGE_LINKS)
llBreakLink(LINK_THIS);
}
}
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
08-01-2008 20:33
your running the permissions on rez
try this it will ask once when script first saved then will work when ever rezed

default {
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
}
on_rez(integer param) {
if (llGetLinkNumber())
if ( PERMISSION_CHANGE_LINKS)
llBreakLink(LINK_THIS);
}

}
_____________________
L$ is the root of all evil
videos work! thanks SL :)
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
08-01-2008 20:54
I see what you're talking about. The thing is, the prims unlink as expected if I just click Yes on all of the permissions requests. However, the prims fail to unlink as expected if I address the permissions requests in a different order. I can't put my finger on why, yet.
_____________________
canis Oh
Registered User
Join date: 30 Mar 2007
Posts: 33
08-02-2008 00:56
lightwave: It's as if you're suggesting that having gained the perm, it travels with the script across derez/rez boundaries? Is that the way it is, rather than the perm being part of the immdiate runtime environment? Is the perm preserved if the owner changes?

Interesting.
canis Oh
Registered User
Join date: 30 Mar 2007
Posts: 33
08-02-2008 03:20
lightwave: I tried this with 4 prims (copying the first) and am finding that though I answered 4 questions, 2 remained linked after the re-rez.
Dovic Battery
Registered User
Join date: 28 Aug 2006
Posts: 6
08-06-2008 04:03
put this one script in the root prim and it will unlink all prims in the set

change llBreakLink(LINK_THIS); to llBreakAllLinks();



default {
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
}
on_rez(integer param) {
if (llGetLinkNumber())
if ( PERMISSION_CHANGE_LINKS)
llBreakAllLinks();
}

}
canis Oh
Registered User
Join date: 30 Mar 2007
Posts: 33
08-06-2008 23:18
From: Dovic Battery
put this one script in the root prim and it will unlink all prims in the set

change llBreakLink(LINK_THIS); to llBreakAllLinks();
...
}


Thanks Dovic, but to unlink all prims is not the intention - only nominated ones.