Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer price = 250; // cost of item
- string object = "NameOfObject"; // Name of object being sold.
- default
- {
- state_entry()
- {
- llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
- }
- run_time_permissions(integer p)
- {
- if( p & PERMISSION_DEBIT)
- {
- llSetObjectDesc(object + " costs " + (string)price + "L$. Right-click and select 'pay' to purchace");
- llSetPayPrice(PAY_HIDE, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
- }
- else
- {
- state suspend;
- }
- }
- money(key id, integer amt)
- {
- if(amt != price || !llSameGroup(id))
- {
- llGiveMoney(id, amt);
- if(!llSameGroup(id)) llWhisper(0, "Remeber to be wearing your group tags!");
- if(amt != price) llWhisper(0, "Price is: " + (string)price + "L$.");
- }
- else
- {
- llGiveInventory(id, object);
- llWhisper(0, "Thanks for buying!");
- }
- }
- touch_start(integer n)
- {
- if(llDetectedKey(0) == llGetOwner())
- {
- llResetScript();
- }
- else
- {
- llWhisper(0, object + " costs " + (string)price + "L$.");
- if(!llDetectedGroup(0)) llWhisper(0, "Only available to our group. Wear your group tag to purchace.");
- }
- }
- on_rez(integer z)
- {
- llResetScript();
- }
- }
- state suspend
- {
- state_entry()
- {
- llSetObjectDesc("Vendor Suspended.");
- }
- touch_start(integer n)
- {
- if(llDetectedKey(0) == llGetOwner()) llResetScript();
- }
- on_rez(integer z)
- {
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement