Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. local gameTime = {
  2. Minutes = 1,
  3. Seconds = 59
  4. }
  5.  
  6. local Ticker = 0
  7.  
  8. tfm.exec.setUIMapName("Time left: 0" .. gameTime.Minutes ..":" ..gameTime.Seconds .."\n")
  9.  
  10. function eventLoop()
  11. Ticker = Ticker + 0.5
  12. if Ticker >= 1 then
  13. Ticker = 0
  14. if gameTime.Minutes >= 1 then
  15. if gameTime.Seconds > 10 then
  16. gameTime.Seconds = gameTime.Seconds - 1
  17. tfm.exec.setUIMapName("Time left: 0" .. gameTime.Minutes ..":" ..gameTime.Seconds .."\n")
  18. else
  19. gameTime.Seconds = gameTime.Seconds - 1
  20. if gameTime.Seconds < 0 then
  21. gameTime.Minutes = 0
  22. gameTime.Seconds = 59
  23. tfm.exec.setUIMapName("Time left: 00:" ..gameTime.Seconds .."\n")
  24. else
  25. tfm.exec.setUIMapName("Time left: 0" .. gameTime.Minutes ..":0" ..gameTime.Seconds .."\n")
  26. end
  27. end
  28. else
  29. if gameTime.Seconds > 10 then
  30. gameTime.Seconds = gameTime.Seconds - 1
  31. tfm.exec.setUIMapName("Time left: 00:" ..gameTime.Seconds .."\n")
  32. else
  33. gameTime.Seconds = gameTime.Seconds - 1
  34. if gameTime.Seconds < 0 then
  35. tfm.exec.newGame('#17')
  36. gameTime.Minutes = 1
  37. gameTime.Seconds = 59
  38. else
  39. tfm.exec.setUIMapName("Time left: 00:0" ..gameTime.Seconds .."\n")
  40. end
  41. end
  42. end
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement