Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

owner only texture switcher

Aztek Aeon
Registered User
Join date: 4 Jan 2008
Posts: 644
07-03-2009 13:17
I have a texture switch script that allows anyone who touches the prim to change the scrpt. I'd like to make it owner only... easy there an easy line I can add to it?

Thanks!
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-03-2009 13:44
Yes, assuming that you have mod permissions for the script. All you have to do is test for llGetOwner(). Exactly where you do the test will depend on what your script looks like, of course, but you can get the idea from . It's a straightforward bit of scripting.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Aztek Aeon
Registered User
Join date: 4 Jan 2008
Posts: 644
07-03-2009 19:23
Hi Rolig, thanks for the link.

Unfortunately, being 150% bimbo when it comes to scripting, I spent over an hour trying to fit that in with my current script, to no avail.

All the info in that link might as well be Russian.

I have been trying very hard to understand LSL but I think I must admit defeat.

I know this is most likely a very easy add to the script & was hoping to solve the issue myself, but I guess thats not going to happen.

Thanks again for your response :)
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-03-2009 20:07
there is a section that goes something like

CODE

touch_start( integer total ){
//-- some stuff here
}

take all the stuff in between and do this to it...
CODE

touch_start( integer total ){
if (llDetectedKey( 0 ) == llGetOwner()){
//-- some stuff here
}
}
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
07-03-2009 22:26
From: Void Singer
there is a section that goes something like

CODE

touch_start( integer total ){
//-- some stuff here
}

take all the stuff in between and do this to it...
CODE

touch_start( integer total ){
if (llDetectedKey( 0 ) == llGetOwner()){
//-- some stuff here
}
}



could also do

CODE

touch_start( integer tota){
if(llDetectedKey(0) != llGetOwner())
return;
//some stuff here
}


Might be easier to do that as someone who doesn't script.. personally I think it's bad coding to return from an event like that.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-04-2009 00:05
I tend to avoid that model too, but in this case it's not so bad... i'd single line it though.. if you aren't going to use braces it might as well all run together
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
07-04-2009 22:58
From: Lazink Maeterlinck
could also do

CODE

touch_start( integer tota){
if(llDetectedKey(0) != llGetOwner())
return;
//some stuff here
}


Might be easier to do that as someone who doesn't script.. personally I think it's bad coding to return from an event like that.


Just curious. Why is that bad?
_____________________
Mote Particle Script Generator - easier and faster than any HUD
Also: Paladin's Sunbeam. Up at dawn, gone by dusk, day and night sounds, fully configurable
See more at: www.paladinpinion.com
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-05-2009 03:13
From: Paladin Pinion
Just curious. Why is that bad?

it's preferable to enclose code segments to avoid errors later when updating and inserting new code... that way the code is guaranteed to run in an unambiguous way.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -