Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to set permission for only the owner to flip the texture.

JR Breed
Registered User
Join date: 17 Jan 2006
Posts: 49
07-28-2006 06:39
I have a script here that when you touch the prim that has the script, it flips though the textures that you have in its contents. Problem is, anyone can flip though the textures on touch when I want only the owner to bealbe to do that. How would I go about setting it to, only the owner can activate the script on touch.

I dont know how to make a window to paste the script coding which I know someone will need to view the script (please tell me how =)). If someone would be willing to help me, it would definitly be greatly apprecaited. Thank you very much in advance.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
07-28-2006 06:42
set a global key variable at the beginning of the script...call it Toucher or something, and on the touch event have it do:

toucher = llDetectedKey(0);
if (toucher != llGetOwner())

..you get the idea
JR Breed
Registered User
Join date: 17 Jan 2006
Posts: 49
07-28-2006 06:54
This is how I enterd it.

integer number;
key toucher;

default
{
on_rez(integer i)
{
number = 0;
}

touch_start(integer total_number)
{
toucher = llDetectKey(0)
if (toucher != llGetOwner())
integer total = llGetInventoryNumber(INVENTORY_TEXTURE);
number = (number + 1);
if (number == total)
{
number = 0;
}
llSetTexture (llGetInventoryName(INVENTORY_TEXTURE, number), ALL_SIDES);
}
}


I get a syntax error at "if (toucher != llGetOwner())" I dont get it. Its mainly the reason why Im asking for a little help. And I really do appreciate you reply Tiarnalalon.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
07-28-2006 06:57
Try this instead...

CODE
integer number;
key toucher;

default
{
on_rez(integer i)
{
number = 0;
}

touch_start(integer total_number)
{
toucher = llDetectedKey(0);
if (toucher == llGetOwner())
{
integer total = llGetInventoryNumber(INVENTORY_TEXTURE);
number = (number + 1);
if (number == total)
{
number = 0;
}
llSetTexture (llGetInventoryName(INVENTORY_TEXTURE, number), ALL_SIDES);
}
}
}
JR Breed
Registered User
Join date: 17 Jan 2006
Posts: 49
07-28-2006 07:06
I get the error "Name not defined within scope" at "llDetectKey(0);" The cursor appears at the 0 once I get the error.

EDIT

I changed "llDetectKey" to llDetetedKey" and it worked.. Thanks a million. You have no idea how much I appreciate you taking the time to help me figure this out. Thank you =))
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
07-28-2006 07:29
Actually I just fixed the problem in the code...I didn't proofread it well enough from what I copied of your code.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
07-28-2006 07:32
From: JR Breed
I get the error "Name not defined within scope" at "llDetectKey(0);" The cursor appears at the 0 once I get the error.

EDIT

I changed "llDetectKey" to llDetetedKey" and it worked.. Thanks a million. You have no idea how much I appreciate you taking the time to help me figure this out. Thank you =))



Ah good. It's np at all. if you wanted you could also add an else if (toucher != llGetOwner()) {llWhisper(0, "You are not my owner.";);} or something *shrug*
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
Punctuation is Important.
07-28-2006 10:49
From: JR Breed
...
touch_start(integer total_number)
{
toucher = llDetectKey(0)
if (toucher != llGetOwner())
integer total = llGetInventoryNumber(INVENTORY_TEXTURE);
....
I get a syntax error at "if (toucher != llGetOwner())" I dont get it. Its mainly the reason why Im asking for a little help. And I really do appreciate you reply Tiarnalalon.
You forgot the semicolon at the end of the line before that.:)