Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How would i go about...

AngelEyes Lewis
Registered User
Join date: 18 Oct 2005
Posts: 49
12-02-2007 19:45
Okay, in this thread /15/36/3038/1.html

the first post is for a simple pay script (what ive been looking for)

But how hard would it be (or time consuming) to make that script sell two separate items?

what i mean is instead of having it sell one item from one prim, could i put (for example) some script lines for it to read two different prices?

(For Example)

integer gPrice = 5;
integer gPrice = 10;

So if someone pays 5L they get a cube sent to them.
If someone pays 10L they get a sphere sent to them.
If someone pays anything else, their money gets refunded.
(im assuming i could put a fast pay code in there so that there are only the two options for payment)

I'm guessing this is an if/then (or else/if?) script job, and i honestly have a hard time with those lines.

So i guess what im asking is, is there a script out there like this already? Do you have any tips, or examples of how other scripts execute this?

Thanks a bunch. And sorry this post ran a little long :/
_____________________
http://slurl.com/secondlife/Jamaica/74/129/30
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
12-02-2007 20:59
This is very simple, actually. The moeny event handler takes two parameters, a key, the UUID of the agent who paid it, and an integer, the amount of money paid. You just need to test what amount was paid, and take the desired action.

money( key id, integer amount )
{
if( amount == 5 )
// give the box to id
else if( amount == 10 )
// give the sphere to id
else
llGiveMoney( id, amount ); // refund
}

Note, you'll need to request PERMISSION_DEBIT from the owner at some point before a refund is to be given.
AngelEyes Lewis
Registered User
Join date: 18 Oct 2005
Posts: 49
12-02-2007 22:52
thank you deanna!! I will start that right now :D
_____________________
http://slurl.com/secondlife/Jamaica/74/129/30