Advertisement
BobMe

bad thing calculator

Jun 25th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. client_age = 30
  2.  
  3. client_death = 85
  4.  
  5. percentage_of_bad = 99999999999999999999 -- (1-100)
  6.  
  7.  
  8.  
  9. local sum = (client_death-client_age)*365
  10. local countup = 0
  11. percentage_of_bad = percentage_of_bad*.01
  12.  
  13. for i=1,sum do
  14. local random = math.random()
  15. if random <= percentage_of_bad then
  16. countup = countup+1
  17. end
  18. end
  19.  
  20. if countup ~= 1 then
  21. print(countup.." bad things happened in the client's "..client_death.." year life span ("..(client_death*365).." days), after the client's tracked age of "..client_age..".")
  22. else
  23. print(countup.." bad thing happened in the client's "..client_death.." year life span ("..(client_death*365).." days), after the client's tracked age of "..client_age..".")
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement