Edie_Shoreland icon

Tip Gift Giver

Edie_Shoreland | PRO | 11/25/18 06:59:00 PM UTC | 0 ⭐ | 9056 👁️ | Never ⏰ | []
Linden Scripting |

0 B

|

None

|

0 👍

/

0 👎

//Based on Toady Nakamura's Simple Recording Tipjar 
//at http://wiki.secondlife.com/wiki/User:Toady_Nakamura/Simple_Recording_Tipjar
 
integer totaldonated;
 
default
{
    on_rez( integer sparam )
    {
        llResetScript();
    }
 
    state_entry()
    {
        llSetText("Tips\nL$0 so far",<1.0,1.0,1.0>,0.85);
    }
 
    money(key id, integer amount)// When someone pays the system records their key & the amount
    {
        totaldonated = totaldonated + amount;
        integer randomIndex = llGetInventoryNumber(INVENTORY_OBJECT);
        randomIndex = (integer)llFrand(randomIndex);
        llSetText("Tips\n L$" + (string)totaldonated + " so far",<1.0,1.0,1.0>,0.85);
        llInstantMessage(id,"Thank you for the tip!, " + llKey2Name(id));
        string itemName = llGetInventoryName(INVENTORY_OBJECT, randomIndex); 
        llGiveInventory(id, itemName);
        llInstantMessage(llGetOwner(), llKey2Name(id) + " just donated $L" + (string)amount);
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎