Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. round = {}
  2.  
  3. -- Variables
  4. round.Break = 30 -- 30 second breaks
  5. round.Time = 300 -- 5 minute rounds
  6.  
  7. -- Read Variables
  8. round.TimeLeft = -1
  9. round.Breaking = false
  10.  
  11. function round.Broadcast(Text)
  12. for k, v in pairs(player.GetAll()) do
  13. v:ConCommand("play buttons/button17.wav")
  14. v:ChatPrint(Text)
  15. end
  16. end
  17.  
  18. function round.Begin()
  19. -- Your code
  20. -- (Anything that may need to happen when the round begins)
  21.  
  22. round.Broadcast("Round starting! Round ends in " .. round.Time .. " seconds!")
  23. round.TimeLeft = round.Time
  24. end
  25.  
  26. function round.End()
  27. -- Your code
  28. -- (Anything that may need to happen when the round ends)
  29.  
  30. round.Broadcast("Round over! Next round in " .. round.Break .. " seconds!")
  31. round.TimeLeft = round.Break
  32. end
  33.  
  34. function round.Handle()
  35. if (round.TimeLeft == -1) then -- Start the first round
  36. round.Begin()
  37. return
  38. end
  39.  
  40. round.TimeLeft = round.TimeLeft - 1
  41.  
  42. if (round.TimeLeft == 0) then
  43. if (round.Breaking) then
  44. round.Begin()
  45. round.Breaking = false
  46. else
  47. round.End()
  48. round.Breaking = true
  49. end
  50. end
  51. end
  52. timer.Create("round.Handle", 1, 0, round.Handle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement