Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Time Crunch: A simple script that will pay the owner one time?

Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
01-03-2006 16:41
I want to give a weddign gift and include a "check" with the card. I only want to pay the new owner one time. I see llGiveMoney, but don't think this is what I want... Is there a pay feture. I know I can just pay the person, but not as neat.

thanks
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
01-03-2006 16:48
AFAIK all the new "pay" features are for paying money in to the script owner, if you wanted to make an item and set the default "pay" price, ect. For giving money from you to someone else, pretty sure you want llGiveMoney. The page at the wiki for this command also has a good basic script, all you'd need to do is change the line that

says llGiveMoney(llDetectedKey(0),1);

to read llGiveMoney(llDetectedKey(0),100);

(assuming you want to give them L$100. Just change the "1" there at the end to how much you want to give them.)

additionally right after that line I would add:

llDie();

Without adding this in, you give someone this item and they can click on it repeatedly until you run out of money. This line makes the object delete itself after giving them the money.
Sydney Alexander
Registered User
Join date: 19 Feb 2005
Posts: 69
01-03-2006 16:56
Hi Logan... I thought about trying this, but what about the"llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);" bit? If I understand it correctly, the object owner is being asked for permission to debit the funds right? Wouldn't this pay them with their own money? I like it, but not a great gift idea. ;0) What about the llDetectedKey(0),1)... making the (0) the Key for my friend.. this will make it so only she can get paid I think and not someone walking by?

From: Logan Bauer
AFAIK all the new "pay" features are for paying money in to the script owner, if you wanted to make an item and set the default "pay" price, ect. For giving money from you to someone else, pretty sure you want llGiveMoney. The page at the wiki for this command also has a good basic script, all you'd need to do is change the line that

says llGiveMoney(llDetectedKey(0),1);

to read llGiveMoney(llDetectedKey(0),100);

(assuming you want to give them L$100. Just change the "1" there at the end to how much you want to give them.)

additionally right after that line I would add:

llDie();

Without adding this in, you give someone this item and they can click on it repeatedly until you run out of money. This line makes the object delete itself after giving them the money.
Buxton Malaprop
Mad Physicist
Join date: 8 Jun 2005
Posts: 118
01-03-2006 21:01
An object can only draw money from the account of the person who owns it (and then only if it's got Permission). You can't give an item to someone else but have it withdraw funds from your account still.

One possible trick would be to have an object (which YOU continue to own) sittting on your land (or on a friend's land if you don't own/rent anywhere specific), and have the "check" object communicate with that server when clicked (probably by email). The server is the object with Debit permissions, and it's yours, so it'll be debiting YOUR account.

You should take VERY GREAT care with this approach if you take it - perhaps send both the detected avatar name in addition to the Key, have the server check that the Name is that of your intended recipient before it gives out money, etc. Also, relinquish the Debit permission as soon as it's been used, to avoid somehow giving out money twice if that's not what you're intending.
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
01-03-2006 21:13
I messed around with this and found that llGiveMoney can ONLY take money from the owner, trying to request debit permissions, then giving the object to someone else causes the permission to be lost. Trying to request debit perms after given causes the object to say "Script asking non-owner for run time permissions only owner can grant." So, you'll just have to pay them directly, or have them touch an object that checks who's touching and give money at that time, like the following:
CODE
integer x;

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

touch_start(integer num)
{
for(x = 0; x < num; ++x)
{
if(llDetectedName(x) == "Recievers Name")
{
llSay(0, "Contrats on the wedding!");
llGiveMoney(llDetectedKey(x), 100);
llDie();
}
}
}
}

When first rezzed, it'll pop up a blue dialog asking for debit perms, just say yes to that. Then rez it and have them touch, it'll say the message and give them the money, then delete itself to prevent multiple payments. Just change "Recievers Name" to their name, capitals count, keep the quotes. Set the message in the say command to whatever you want, and the number in the llGiveMoney to however much you want to give.
_____________________
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
01-03-2006 21:33
if you wanted to give a keepsake object with the check script in it, use

llRemoveInventory(llGetScriptName());

instead of llDie();

leaves the object deletes the script :) (make it no copy)