Advertisement
BobMe

Logout reward timer

Dec 3rd, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. saved_variable = 1543857838 -- this would be a variable that has been saved
  2. -- into the cloud from the last time the player logged
  3. -- out
  4.  
  5. logouttimeout = saved_variable+25200 -- the time the player needs until they
  6. -- receive their next logon bonus
  7. --
  8.  
  9. seconds=logouttimeout-os.time() -- this will print the time left for the reward
  10. minutes=0 -- using the code below
  11. hours=0
  12.  
  13. while seconds>60 do
  14. minutes=minutes+1
  15. seconds=seconds-60
  16. end
  17. while minutes>60 do
  18. hours=hours+1
  19. minutes=minutes-60
  20. end
  21.  
  22. if seconds==60 then seconds=seconds-60 minutes = minutes+1 end
  23. if minutes==60 then minutes=minutes-60 hours = hours+1 end
  24.  
  25. if seconds <= 0 and hours <= 0 and minutes <= 0 then
  26. print("LOGOUT REWARD REQUIRED")
  27. end
  28.  
  29. if seconds == 0 then
  30. seconds = "00"
  31. end
  32. if minutes == 0 then
  33. minutes = "00"
  34. end
  35. if hours == 0 then
  36. hours = "00"
  37. end
  38.  
  39. print("hh:mm:ss")
  40. print(hours..":"..minutes..":"..seconds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement