Advertisement
PlayStationUser99

How to make a JToH Fangame! | Part 3 (ModuleScript)

Jul 21st, 2021
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. local module = {}
  2.  
  3. function module.Timer()
  4. local millaseconds = 0
  5. local seconds = 0
  6. local minutes = 0
  7.  
  8. local MillasecondsValue = script.Millaseconds
  9. local SecondsValue = script.Seconds
  10.  
  11. while wait(0.01) do
  12. millaseconds += 3
  13. if seconds < 10 then
  14. SecondsValue.Value = "0"..seconds
  15. else
  16. SecondsValue.Value = seconds
  17. end
  18. if millaseconds < 10 then
  19. MillasecondsValue.Value = "0"..millaseconds
  20. else
  21. MillasecondsValue.Value = millaseconds
  22. end
  23.  
  24. script.Parent.Text = minutes..":"..SecondsValue.Value.."."..MillasecondsValue.Value
  25.  
  26. if millaseconds > 99 then
  27. millaseconds = 0
  28. seconds += 1
  29. end
  30. if seconds == 60 then
  31. seconds = 0
  32. minutes += 1
  33. end
  34. end
  35. end
  36.  
  37. return module
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement