Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- How many hours till restart happens
- restartTime = 4
- -- Calculate hours to seconds minus announcement times
- -- then start a timer at that amount
- timer = os.startTimer( (restartTime * 3600) - 600 )
- -- Listen for our timer. When time is hit,
- -- move on to messaging loop
- while true do
- event,p1 = os.pullEvent("timer")
- if timer == p1 then
- break
- end
- end
- -- Announcements at periodic times
- -- sleep time equals announce time minus the next announce time
- commands.exec("say Server Restarting In 10 minutes")
- sleep(300)
- commands.exec("say Server Restarting In 5 Minutes")
- sleep(240)
- commands.exec("say Server Restarting In 1 Minute")
- sleep(50)
- commands.exec("say Server Restarting In 10 Seconds")
- sleep(5)
- commands.exec("say Server Restarting In 5...")
- sleep(1)
- commands.exec("say Server Restarting In 4...")
- sleep(1)
- commands.exec("say Server Restarting In 3...")
- sleep(1)
- commands.exec("say Server Restarting In 2...")
- sleep(1)
- commands.exec("say Server Restarting In 1...")
- sleep(1)
- commands.exec("stop")
Advertisement
Add Comment
Please, Sign In to add comment