Advertisement
HowToRoblox

LiveEventHandler

Mar 19th, 2021
2,936
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 1 0
  1. local timeOfEvent = os.time({year = 2021, month = 3, day = 20, hour = 6, min = 0, sec = 0})
  2.  
  3.  
  4. local timeLabel = script.Parent.TimeGui.TimeText
  5.  
  6. local rocket = script.Parent.Parent.Rocket
  7.  
  8.  
  9. local ts = game:GetService("TweenService")
  10. local ti = TweenInfo.new(10, Enum.EasingStyle.Exponential, Enum.EasingDirection.In)
  11.  
  12.  
  13. while wait(1) do
  14.    
  15.     local timeDifference = timeOfEvent - os.time()
  16.    
  17.    
  18.     if timeDifference >= 0 then
  19.        
  20.         local h = math.floor(timeDifference/60/60)
  21.         local m = math.floor(timeDifference/60) - (h*60)
  22.         local s = timeDifference - (m*60) - (h*60*60)
  23.        
  24.         local hms = string.format("%02i", h) .. ":" .. string.format("%02i", m) .. ":" .. string.format("%02i", s)
  25.        
  26.         timeLabel.Text = hms
  27.        
  28.        
  29.         if timeDifference == 0 then
  30.            
  31.            
  32.             ts:Create(rocket, ti, {CFrame = rocket.CFrame + Vector3.new(0, 10000, 0)}):Play()
  33.            
  34.             break
  35.         end
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement