Randon $L Giver
De DigiWiki.
For this script, pay in 10-100, and get something back every time. The script picks a number , and determins the pay scale. 1.8 x bet is the max.
// Randon $L Giver by Shippou Oud integer pi; integer po; string wnnr; integer pyo; default { on_rez(integer x) { llResetScript(); } state_entry() { pi = 0; po = 0; llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); llSetTextureAnim(SMOOTH | LOOP | ANIM_ON, ALL_SIDES,0,0,0,0,.25); llSetText("Win Random $L \n Bet from $L10 to $L100 \n " + wnnr + " has won $L" + (string) pyo + "\n Total Payout $L" + (string) po, <1.0, 1.0, 1.0>, 1.0); } touch_start(integer x) { if (llDetectedKey(0) == llGetOwner()) { llInstantMessage(llGetOwner(),"Total Pay In $L" + (string) pi); } } money(key player, integer mon) { if (mon > 100) { llInstantMessage(player,"Sorry this is too much, here is your refund"); llGiveMoney(player,mon); } else if (mon < 10) { llInstantMessage(player,"Sorry this is not enough. Please bet $L10 or more, here is your refund"); llGiveMoney(player,mon); } else { pi = pi + mon; llInstantMessage(player,"Good Luck"); integer wun = mon * 2 - 2; integer wun1 = (integer)llFrand(wun) + 1; llGiveMoney(player,wun1); wnnr = llKey2Name(player); pyo = wun1; po = po + wun1; llInstantMessage(player, "Congradulations, you won $L" + (string) wun1); llSetText("Win Random $L \n Bet from $L10 to $L100 \n " + wnnr + " has won $L" + (string) pyo + "\n Total Payout $L" + (string) po, <1.0, 1.0, 1.0>, 1.0); llInstantMessage(player,"Thank you for playing."); } } run_time_permissions(integer perm) { if (PERMISSION_DEBIT & perm) {;} else { llInstantMessage(llGetOwner(), "Sorry, you must click 'yes' to operate this."); llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); } } }