|
Gen Huskerdu
Total Idiot
Join date: 8 Jun 2006
Posts: 3
|
06-11-2006 15:34
I'm looking for an example of a script that prevents someone from sitting on the object the script is inserted in. I'm still fairly new to scripting, and as such, I have little to no idea of how to go about this. Any older scriptings willing to lend a hand?
|
|
Mod Faulkner
Registered User
Join date: 11 Oct 2005
Posts: 187
|
Old pose ball scripts
06-11-2006 16:06
Many of the pose ball scripts check the key id of the person attempting to sit and disallow it if it is not the owner. I would think you could modify one of those to dissallow anyone. Look under the changed link section for something like if(id != llGetOwner()); and change that to something that to a key that cannot be matched. Or, because you are the owner, leaving it as it is would stop anyone else from sitting there.
|
|
Moonshine Herbst
none
Join date: 19 Jun 2004
Posts: 483
|
06-11-2006 16:12
You could use something like this: key av; default { state_entry() { } changed(integer change) { if(change & CHANGED_LINK) { av = llAvatarOnSitTarget(); if(av != NULL_KEY) { llUnSit(av); } } } }
|
|
Gen Huskerdu
Total Idiot
Join date: 8 Jun 2006
Posts: 3
|
06-11-2006 16:28
Ok...Faulkner, your idea may work, but what I was thinking of is something that prevents even the attempt to sit. I've seen examples of this in action, for example, in some types of cage/web guns. The option to sit is replaced with something like "Nice Try" and the avatar doesn't even try to sit on the object. Where as most object that only let their own use them, well place the avatar attempting to sit in the right location, but then will reject the action.
|
|
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
|
06-11-2006 16:44
From: Gen Huskerdu Ok...Faulkner, your idea may work, but what I was thinking of is something that prevents even the attempt to sit. I've seen examples of this in action, for example, in some types of cage/web guns. The option to sit is replaced with something like "Nice Try" and the avatar doesn't even try to sit on the object. Where as most object that only let their own use them, well place the avatar attempting to sit in the right location, but then will reject the action. Its all in how you set it up, its actually the same thing. You cant outright block the attempt, but you can act as if nothing happened. For example, change the sit text (easy) and, in the case of a cage gun, just have the sitpos be the very center of the object.
_____________________
I am myself indifferent honest; but yet I could accuse me of such things that it were better my mother had not borne me: I am very proud, revengeful, ambitious, with more offenses at my beck than I have thoughts to put them in, imagination to give them shape, or time to act them in. What should such fellows as I do crawling between earth and heaven? We are arrant knaves, all; believe none of us.
|
|
Gen Huskerdu
Total Idiot
Join date: 8 Jun 2006
Posts: 3
|
06-11-2006 16:47
Ah. Thanks. It's a bit beyond my ability, right now, I guess. But I have something to work for. Hopefully I get it figured out soon. Thanks for the help, guys.
|
|
Zalandria Zaius
Registered User
Join date: 17 Jan 2004
Posts: 277
|
06-11-2006 17:21
From: Moonshine Herbst You could use something like this: key av; default { state_entry() { llSitTarget(<0,0,.1>, ZERO_ROTATION); llSetSitText("NoSit");
} changed(integer change) { if(change & CHANGED_LINK) { av = llAvatarOnSitTarget(); if(av != NULL_KEY) { llUnSit(av); } } } } The previous script will work for what your looking for with a few modifications. You have to use llSitTarget for llAvatarOnSitTarget() to work. Plus I added the function to change the Sit text.
|