I had it working but wanted to add a message to say if there wasn't' any objects in the item when someone clicked on it and then for the pay button to then light up.
Thanks for you're time
Willy...
[CODE]
integer payprice = 1;
integer total_number;
default
{
touch_start(integer total_number)
{
llWhisper(0, "Click to play the Lucky Dip"
;if(llGetInventoryName(INVENTORY_OBJECT,0)!=0);
{
llSay(0, "Sorry all prizes have been given out. More will be added shortly"
;}
}
state_entry()
{
llSetPayPrice(payprice, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
llSetTimerEvent(5);
llSay(0, "Pay: L$"+(string)payprice); //add please Pay $40 to play the Lucky Dip
money(key giver, integer amount) {
//llSay(0, "Thanks for the " + (string)amount + "L$, " + llKey2Name(giver));
{
integer total = llGetInventoryNumber(INVENTORY_OBJECT);
if(llGetInventoryName(INVENTORY_OBJECT,0)!=""
{llGiveInventory(giver,llGetInventoryName(INVENTORY_OBJECT,(integer)llFrand(total)));}else
llWhisper(0,"Thanks for playing Lucky Dip!"
;}
}
}
}
[/CODE]
