Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Money permissions in rezzed objects

Leon Castro
Registered User
Join date: 27 Sep 2006
Posts: 9
10-05-2007 20:42
I am trying to make an object that rezzes coins that give a payout on touch. I have got this to work when I use it (someone can recieve payment from a rezzed coin) but when I give the rezzer to someone else the rezzer doesnt request permission to take money and the coins doesnt payout.

Can anyone help me to understand how to request payout permissions for an object that is not yet rezzed out of the rezzers inventory. and why in my above description it worked for me and not someone else.
Flennan Roffo
Scripter
Join date: 29 Sep 2007
Posts: 26
10-05-2007 20:43
Post the script and we can help you trace the problem.
_____________________
Logic Scripted Products and Script Services
Peacock Park (187,228,69)

*** Get your free copy of SL Mail today! ***
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-05-2007 20:56
Put a llResetScript function in an on_rez event like in this thread:

/54/cf/215009/1.html
_____________________
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
Leon Castro
Registered User
Join date: 27 Sep 2006
Posts: 9
10-05-2007 21:03
I have to say thankyou to everyone who submits scripts, advice and help here and on the wiki and inworld, I think I have taken a line from everyone by now

This is the script for the coin (money example off wiki) and I put thellRequestPermissions line in the rezzer within default. NOTE: I want the coins to already have permission on rez.

[Script]
integer AMOUNT = 1;

default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT );
}

run_time_permissions (integer perm)
{
if(perm & PERMISSION_DEBIT)
{
state ready;
}
}
}

state ready
{
state_entry()
{}
touch_start(integer num)
{
llGiveMoney(llDetectedKey(0), AMOUNT);
llShout(0, "" + llDetectedName(0) + " has found a treasure and has been paid ";);
llDie();

}

}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-05-2007 21:27
Here you go:

ooops scratch that. OK I reread your post SLOWLY this time and am comprehending what you were asking finally.

The person that you give the rezzer to would need to have a coin also that would get thier permissions and then they could put it in the rezzer. But this means they would need mod rights on the coins and rezzer. And still don't know if they would get permission without having an on_rez or changed event in the coin. Either case would be a pain.

Anybody have any ideas?
_____________________
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
Leon Castro
Registered User
Join date: 27 Sep 2006
Posts: 9
10-05-2007 22:28
Thankyou Jesse and Flennan,

Is this correct?

The creator grants payments in the rezzed object and not the rezzer.
If the creator grants permission to take money from them when they save the script in their own soon to be rezzed object it will not need further granting when it rezzes.


Can this from void slinger pointed out above still help me?
CODE

changed( integer vBitChanges ){
if (vBitChanges & CHANGED_OWNER){
llResetScript();
}
}


Thankyou.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-06-2007 07:28
From: Leon Castro
Thankyou Jesse and Flennan,

Is this correct?

The creator grants payments in the rezzed object and not the rezzer.
If the creator grants permission to take money from them when they save the script in their own soon to be rezzed object it will not need further granting when it rezzes.


Can this from void slinger pointed out above still help me?
CODE

changed( integer vBitChanges ){
if (vBitChanges & CHANGED_OWNER){
llResetScript();
}
}


Thankyou.


Yep that should work but they will still need to be given an empty rezzer and then a coin seperately. If they rez the coin 1st into world it will change owners and get permission and then they could put it into the inventory of the rezzer. From then on when a coin was rezzed, it would already have the permissions set.
_____________________
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
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-06-2007 07:39
But I must point out that you still need to be extremely carefully and do A LOT of testing whenever you use PERMISSION_DEBIT in a script. You are dealing with REAL play money and a mistake can be very expensive.

For example, in your rezzer, is it set to only rez a set number of times? Is it set to check to see if the same person is touching it again and again etc. A case like this is when having either an alt or a trsuted freind comes in handy for testing. Can 1 person stand there at the rezzer and keep touching it and keep getting coins until the owners account has 0 lindens? What happens if the rezzer is placed in a place with high traffic and 5,000 people touch it, result in the giving away of $L5,000?

You need to go through every possible scenario of things that could go wrong. Because if anything can go wrong then it will.
_____________________
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
Leon Castro
Registered User
Join date: 27 Sep 2006
Posts: 9
10-07-2007 06:42
Thankyou Jesse great help