Advertisement
BobMe

I forgot what I was doing..

Apr 8th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Account_Age = 2585 -- (in days) (game.Players.Player.AccountAge)
  2.  
  3. function dec(AA,Amount_of_decimals)
  4. local g = "0."
  5.  
  6. for i=1,Amount_of_decimals do
  7. if i ~= Amount_of_decimals then
  8. g = g.."0"
  9. else
  10. g = g.."1"
  11. end
  12. end
  13. g=tonumber(g)
  14. local ekk = g
  15. for i=1,string.len(AA) do
  16. if string.sub(AA,i,i) == "." then
  17. if tonumber(string.sub(AA,i+Amount_of_decimals+1,i+Amount_of_decimals+1)) >= 5 then
  18. AA = tonumber(string.sub(AA,1,i+Amount_of_decimals))
  19. AA = AA+ekk
  20. else
  21. AA = tonumber(string.sub(AA,1,i+Amount_of_decimals))
  22. end
  23. end
  24. end
  25. return AA
  26. end
  27.  
  28. function math.round(AA)
  29. num = tostring(AA)
  30. for i=1,#num do
  31. if string.sub(num,i,i) == "." then
  32. if string.sub(num,i+1,i+1) ~= "" and tonumber(string.sub(num,i+1,i+1)) >= 5 then
  33. num2 = string.sub(num,1,i-1)
  34. num2 = tonumber(num2) + 1
  35. elseif string.sub(num,i+1,i+1) ~= "" and tonumber(string.sub(num,i+1,i+1)) < 5 then
  36. num2 = string.sub(num,1,i-1)
  37. num2 = tonumber(num2)
  38. end
  39. end
  40. end
  41. return num2
  42. end
  43.  
  44.  
  45. local years = dec(Account_Age/365,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement