Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Ignoring the owner on touch...

Schuyler Kent
Registered User
Join date: 30 Jan 2005
Posts: 22
12-20-2006 12:05
OK I think this shold be simple to do, but I am crounched for time and can't nail this. I am wearing an object that when clicked it gives the clicker inventory items and launches a URL. Now all this works just fine the bit I can't get is how do I get the object not to give me the "stuff" everythime I click myself?

I assume it is an if/else if (llDetectedKey==id)? When sees the its owner it ingores the click, but gives all others the items... am I crazy?
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-20-2006 12:09
do something like

CODE


if(llDetectedKey(0) !=llGetOwner())
{
llGiveInventory(...);
}


that should only give out the inventory when someone other than the owner clicks
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Schuyler Kent
Registered User
Join date: 30 Jan 2005
Posts: 22
12-20-2006 12:28
still giving the owner the items...

CODE

default
{
state_entry()
{
//llSay(0, "Hello, Avatar!");

}
touch_start(integer total_number)
{
if(llDetectedKey(0) !=llGetOwner())

llInstantMessage(llDetectedKey(0), "Happy Holidays " + llDetectedName(0) +". Thank you for your interest in my product.");
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_NOTECARD, 0));
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_LANDMARK, 0));
llLoadURL(llDetectedKey(0), "My web site", "http://www.mysite.com");

}
}
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
12-20-2006 12:48
you left out the brackets:

CODE

default
{
state_entry()
{
//llSay(0, "Hello, Avatar!");

}
touch_start(integer total_number)
{
if(llDetectedKey(0) !=llGetOwner())
{
llInstantMessage(llDetectedKey(0), "Happy Holidays " + llDetectedName(0) +". Thank you for your interest in my product.");
llGiveInventory(llDetectedKey(0),llGetInventoryNam e(INVENTORY_NOTECARD, 0));
llGiveInventory(llDetectedKey(0),llGetInventoryNam e(INVENTORY_LANDMARK, 0));
llLoadURL(llDetectedKey(0), "My web site", "http://www.mysite.com");
}

}
}
Schuyler Kent
Registered User
Join date: 30 Jan 2005
Posts: 22
12-20-2006 12:50
S&%T!

thanks Darien - Happy Holidays!
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
12-21-2006 12:35
No problem, Happy Holidays :)