Mitzie Mohr
Registered User
Join date: 10 Feb 2007
Posts: 10
|
11-19-2009 12:13
How is a script set so that only the Owner can run it?
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
11-19-2009 12:22
There are many answers to that question, depending on what the script is meant to do. In general, though, if you test for llGetOwner() before you let the script do anything, that pretty much locks out anyone else..... default { state_entry() { llListen(234,"",llGetOwner(),""); // Listen to the owner only }
listen(integer channel, string name, key id, string msg) { // Do stuff, but only if the owner said to }
touch_start(integer num_detected) { if (llDetectedKey(0) == llGetOwner()) { // Do stuff, but only if the owner touched me } } }
And so forth ........ ETA: Of course, you can also make the script no mod and click the "running" box off. Then you're the only one who can click it back on again. 
_____________________
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 
|
Lennard Denver
Registered User
Join date: 20 Jun 2009
Posts: 9
|
11-19-2009 12:23
Check who is touching/ colliding and if it's the owner do stuff: if(llDetectedKey(0)==llGetOwner()) { // do stuff }
|