Advertisement
Ypleitez

Untitled

Nov 11th, 2023
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. math.randomseed(os.time())
  2.  
  3. function apuesta(balance, base_bet)
  4. local chance = 90
  5. local bet_amount = balance / 1000000
  6.  
  7. for i = 1, 10 do
  8. local random_chance = math.random(1, 100)
  9. if random_chance <= chance then
  10. -- Gana
  11. print("Ganaste " .. bet_amount .. " unidades.")
  12. break
  13. else
  14. -- Pierde
  15. print("Perdiste " .. bet_amount .. " unidades.")
  16. if i < 5 then
  17. base_bet = base_bet * 10 -- Incrementa la base bet para la max bet
  18. else
  19. local losses = 0
  20. for j = 1, 5 do
  21. local random_chance = math.random(1, 100)
  22. if random_chance > chance then
  23. losses = losses + 1
  24. end
  25. end
  26. if losses >= 2 then
  27. base_bet = base_bet * 10 -- Incrementa la base bet para la max bet
  28. end
  29. end
  30. bet_amount = base_bet
  31. end
  32. end
  33. end
  34.  
  35. -- Ejemplo de uso
  36. local balance = 1000000 -- Puedes ajustar esto según tu saldo inicial
  37. local base_bet = balance / 1000000
  38.  
  39. apuesta(balance, base_bet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement