Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

unlink,not owner

Kiwi Lippmann
Registered User
Join date: 22 Aug 2004
Posts: 2
06-20-2005 17:26
hi im try to make it so that i other aves can unlink prims from object that i own,
within script, it works with me as i am the owner,but cant get it to work with non owner

any ideas ?

Thanks Kiwi Lippmann
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
06-20-2005 18:40
In your root prim, put this script in:

CODE

string START_PHRASE = "start linkmod";// Phrase to enter interactive mode.
string END_PHRASE = "stop linkmod"; // Phrase to exit interactive mode.
float LINK_MANIPULATION_TIMEOUT = 20; // Seconds to stay in interactive mode.
integer dialogChannel;
integer listenHandle;
key manipulator;
default {
state_entry() {
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
}

run_time_permissions(integer perms) {
if (perms & PERMISSION_CHANGE_LINKS) {
llListenRemove(listenHandle);
listenHandle = llListen(0, "", NULL_KEY, START_PHRASE);
} else {
llListenRemove(listenHandle);
}
}
listen(integer chan, string name, key id, string msg) {
manipulator = id;
state interactive;
}
}

state interactive {
state_entry() {
if (manipulator != llGetOwner())
llListen(0, "", manipulator, END_PHRASE);
llListen(0, "", llGetOwner(), END_PHRASE);
dialogChannel = (integer)llFrand(18281) + 1;
llListen(dialogChannel, "", manipulator, "");
llPassTouches(TRUE);
llInstantMessage(manipulator, "System keyed to " + llKey2Name(manipulator) + ", touch prim to unlink it.");
llInstantMessage(manipulator, "System will timeout in " + (string) LINK_MANIPULATION_TIMEOUT + " seconds.");
llSetTimerEvent(LINK_MANIPULATION_TIMEOUT);
}

touch_start(integer tn) {
integer i;
for (i = 0; i < tn; ++i) {
if (llDetectedKey(i) == manipulator) {
integer linkNum = llDetectedLinkNumber(i)
llDialog(manipulator, "Are you sure you want to unlink prim " + (string)linkNum + "?", [(string)linkNum + " Yes", "No"], dialogChannel);
}
}
llSetTimerEvent(LINK_MANIPULATION_TIMEOUT); // Reset the timer.
}

run_time_permissions(integer perms) {
if (!(perms & PERMISSION_CHANGE_LINKS)) {
llInstantMessage(manipulator, "Warning: lost linking permissions.");
state default;
}
}

listen(integer chan, string name, key id, string message) {
if (chan == dialogChannel) {
if (message != "No") {
integer linkNum = (integer) message;
llBreakLink(linkNum);
llDialog(manipulator, "Broke link# " + (string) linkNum, [], -1);
}
} else {
state default;
}
}

timer() {
llInstantMessage(manipulator, "Link manipulation timeout.");
state default;
}

state_exit() {
llInstantMessage(manipulator, "Link manipulation shut down.");
}
}


This works by letting people unlink by saying a specific phrase, in this case "start linkmod" to to let a person unlink prims. The person can then touch each prim they want to unlink. The person exits the unlink mode by saying "end linkmod"

Hope this helps!
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
06-20-2005 18:45
You could also make the object modifyable by people in a certain group. This way you dont need to use something other then the prim edit mode to do what you want.

==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm