Joriangames

Live event with countdown script

Mar 17th, 2021 (edited)
3,951
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. --Thanks for using this script
  2. --This script is made by Joriangames/Problox Studio Scripts
  3. --Want to know how to use this? Watch my tutorial: https://youtu.be/yTggbpPRULQ
  4.  
  5. local launchEvent = workspace.RocketModel.Launch
  6. local EventStart = 1615996980
  7. local EventStop = 1615997040
  8.  
  9. local EventTime = workspace.EventText.TextPart.SurfaceGui.EventTime
  10.  
  11. while wait(1) do
  12.     local currentTime = os.time()
  13.    
  14.     if currentTime >= EventStop then
  15.         break
  16.     end
  17.    
  18.     if currentTime >= EventStart then
  19.         launchEvent:Fire()
  20.         EventTime.Text = "Starting live event!"
  21.         break
  22.        
  23.     else
  24.         local secondsleft = EventStart - currentTime
  25.         local days = math.floor(secondsleft % (60*60*24*30) / (60*60*24))
  26.         local hours = math.floor(secondsleft % (60*60*24) / (60*60))
  27.         local minutes = math.floor(secondsleft % (60*60) / 60)
  28.         local seconds = secondsleft % 60
  29.        
  30.         EventTime.Text = "Time till live-event: "..days.." Days "..hours.." Hours "..minutes.." Minutes "..seconds.." seconds!"
  31.        
  32.     end
  33. end
Add Comment
Please, Sign In to add comment