Onwer permissions
|
|
Nectere Niven
Gadget Junky
Join date: 12 Jan 2007
Posts: 211
|
12-02-2007 13:14
I keep trying in a few different ways to get the following script to only work for the owner of this object - so far nothing I have tried has worked - can anyone point me in the right direction? I keep getting syntax errors all over the place, I am not sure I understand open and close brackets either, heck I dont understand much of LSL at all, but I keep trying. string inventory; string object;
default { state_entry() { if (llDetectedOwner(0) == llGetOwner()); { llSitTarget(<2.25,5,.1>,ZERO_ROTATION); } } changed(integer change) { if (change & CHANGED_LINK) {
if(llAvatarOnSitTarget() != NULL_KEY) // if someone is sitting llUnSit(llAvatarOnSitTarget()); }
object=llGetInventoryName(INVENTORY_OBJECT,0); llRezObject(object, llGetPos() + <.5, 5.2, 4.75>, ZERO_VECTOR, ZERO_ROTATION, 0); } object_rez(key id) { llResetScript(); } }
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-02-2007 13:27
Hi Nectere,
There are a couple of problems with the way you have things laid out. It is no problem getting it to work for the owner but....... It would be easier if you said in plain language, what exactly you are trying to get happen and when.
The way it is laid out now, whenever anyone sits then they are are booted off and whenever someone sits or unsits, it will rezz an object. If you do not want anyone to sit, what about doing away with the changed event and go with some ohter event such as collision, touch sensor etc. It is not a problem with making it so any of them would work for just the owner.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Nectere Niven
Gadget Junky
Join date: 12 Jan 2007
Posts: 211
|
12-02-2007 13:38
If the object is owned and touched by the owner - do stuff Else if the object is touched by a non owner - do nothing, or llSay(0,"You dont own me."  Now how I go about writing the above has me baffled Basically what the above is for is - its a box, when the owner touches it, it moves the owner to a specified location (the sit/unsit event - like a teleport) and rezes an object from its inventory. I have tried a few different ways of writing the above, pouring over all my owner type scripts, the wiki and these forums and nothing I have tried works, or I get errors. I have the object set to default sit in the general panel so the owner does not have to choose right click sit but instead just touches it. I am not sure if I am making sense or not
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-02-2007 15:11
Don't understand what the problem was. llOwner tests are in a whole bunch of scripts. string object; key owner;
default { state_entry() { object = llGetInventoryName(INVENTORY_OBJECT,0); owner = llGetOwner(); llSitTarget(<2.25,5,.1>,ZERO_ROTATION); } changed(integer change) { if(change && CHANGED_LINK) { key av_sit = llAvatarOnSitTarget(); if(av_sit == owner) { llRezObject(object, llGetPos() + <.5, 5.2, 4.75>, ZERO_VECTOR, ZERO_ROTATION, 0); } else if(av_sit != NULL_KEY) { llUnSit(av_sit); } } } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Nectere Niven
Gadget Junky
Join date: 12 Jan 2007
Posts: 211
|
12-02-2007 15:58
Awesome that solved most of my issues string object; key owner;
default { state_entry() { object = llGetInventoryName(INVENTORY_OBJECT,0); owner = llGetOwner(); llSitTarget(<2.25,5,.1>,ZERO_ROTATION); } changed(integer change) { if(change && CHANGED_LINK) { key av_sit = llAvatarOnSitTarget(); if(av_sit == owner) { llRezObject(object, llGetPos() + <.5, 5.2, 4.75>, ZERO_VECTOR, ZERO_ROTATION, 0); llUnSit(llAvatarOnSitTarget()); } else if(av_sit != NULL_KEY)
llUnSit(av_sit); } } }
Except that I was hoping that when the nonowner touched it - it did nothing at all, but a canceled sit works fine too. I dont understand why "if (llDetectedOwner(0) == llGetOwner());" didnt work tho, is it where I had it? Was it simply the wrong request to put in to detect that only the owner can make this thing operate(and or sit aka tp to specific point) Also why I cant put a return at the end of else if (av_sit !=NULL_KEY) to do nothing, as in not allow a sit, rather than sitting the nonowner anyway and then unsitting them. Not sure if that made sense. Thank you!
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
12-02-2007 16:23
From: Nectere Niven Awesome that solved most of my issues
Except that I was hoping that when the nonowner touched it - it did nothing at all, but a canceled sit works fine too. It works correctly, it will unsit the non owner and it won't rezz the object. From: Nectere Niven I dont understand why "if (llDetectedOwner(0) == llGetOwner());" didnt work tho, is it where I had it? Was it simply the wrong request to put in to detect that only the owner can make this thing operate(and or sit aka tp to specific point)
Where you had it was an empty if test. An if test needs to be followed by instructions. Instructions which tell it what to do if it passes or fails. From: Nectere Niven Also why I cant put a return at the end of else if (av_sit !=NULL_KEY) to do nothing, as in not allow a sit, rather than sitting the nonowner anyway and then unsitting them. Not sure if that made sense.
Edit: Didn't really explain this part right. You don't want anyone but the owner to sit, right? The only way to so that is to test who is already sitting. Doesn't matter it if is sitting by touching because of the setting in edit or because they right clicked and picked sit. Ooops there might be another way but I will have to test it 1st and it would involve undoing the sit option in edit. From: Nectere Niven Thank you!
YVW and welcome to the forum!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|