Difference between revisions of "How do I make a donation box?"
Jump to navigation
Jump to search
m (moved How do I make a donation box to How do I make a donation box?: Correcting page title from import!) |
(llPseudoList2List() + <lsl>) |
||
Line 1: | Line 1: | ||
{{KBmaster}} | {{KBmaster}} | ||
A donation box is a scripted object that | A donation box is a scripted object that Resident can right-click (CMD-click on Macintosh) and pay without receiving a service or object in return. You can make any object a donation box by adding a small script to it. To do so: | ||
# Right-click the object inworld and choose '''Edit'''. | |||
# Click on the '''Content''' tab. (Click '''More''' if you don't see it.) | |||
# Click the '''New Script''' button. | |||
# Delete everything in the script. Copy and paste the text in the box below. | |||
# Click '''Save'''. If the compile is complete, close the script window and editing window. The '''Pay''' option should now appear in the pie menu when a Resident right-clicks on the object. Sample Donation Script: | |||
<lsl> | |||
default { | |||
touch_start(integer total_number) { | |||
llSay(0, "Please right-click me and select 'Pay...' to donate."); | |||
} | |||
money(key giver, integer amount) { | |||
string donor = llKey2Name(giver); | |||
llInstantMessage(giver,"Thank you for your donation, " + donor + "!"); | |||
llInstantMessage(llGetOwner(),donor + " has donated '''L'''$" + (string)amount + " to you."); | |||
} | |||
}</lsl> | |||
Once the script is installed, you can easily change the donation box's properties to accept left-clicks as well. | |||
# If you've closed the editing window, right-click the object and choose '''Edit''' again. | # If you've closed the editing window, right-click the object and choose '''Edit''' again. |
Revision as of 15:52, 13 October 2009
A donation box is a scripted object that Resident can right-click (CMD-click on Macintosh) and pay without receiving a service or object in return. You can make any object a donation box by adding a small script to it. To do so:
- Right-click the object inworld and choose Edit.
- Click on the Content tab. (Click More if you don't see it.)
- Click the New Script button.
- Delete everything in the script. Copy and paste the text in the box below.
- Click Save. If the compile is complete, close the script window and editing window. The Pay option should now appear in the pie menu when a Resident right-clicks on the object. Sample Donation Script:
<lsl> default {
touch_start(integer total_number) { llSay(0, "Please right-click me and select 'Pay...' to donate."); } money(key giver, integer amount) { string donor = llKey2Name(giver); llInstantMessage(giver,"Thank you for your donation, " + donor + "!"); llInstantMessage(llGetOwner(),donor + " has donated L$" + (string)amount + " to you."); }
}</lsl>
Once the script is installed, you can easily change the donation box's properties to accept left-clicks as well.
- If you've closed the editing window, right-click the object and choose Edit again.
- Make sure you're on the General tab in the Editor. (Click More if you don't see it.)
- At the bottom left, you'll see a dropdown list labeled When Left-Clicked:
- Set the option to Pay and close the editing window.