Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Compare object owner and object creator

John Goodman
Registered User
Join date: 3 May 2006
Posts: 2
03-21-2008 16:00
Hi there , I've been working on a project , a type of rezzing device but would like it to only rezz prims created by it's owner , well the rezzer works just fine but now I need to put in a stand alone script that will detect CHANGED_INVENTORY and get the creator of the object dropped into the rezzer and compare that to the owner of the rezzer and if not the same , remove inventory object . I had seen an example script like that here at the forums but I just can't find it :( . I have an idea as to how to approach this but I totally mess up on the logic , can anyone help out , many thanks in advance .

Goes something like this ?

CODE

default
{
state_entry()
{
llSay(0, "Confirming");

}
changed(integer change)
{
if(change & CHANGED_INVENTORY)
{

//Now here is were it gets confusing to me
key llGetInventoryCreator(string item)
and compare to owner of rezzer

if object creator and object owner are not the same

delete inventory object

llSay( 0, "remove inventory object" );

}
}
}


CODE
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
03-21-2008 16:10
I'm not sure exactly what problem you're having, but the basic fragment to do what you want is

CODE

if (llGetInventoryCreator(item) != llGetCreator()) {
llRemoveInventory(item);
}
John Goodman
Registered User
Join date: 3 May 2006
Posts: 2
03-21-2008 18:56
Thanks Kidd , that did the trick :)