Advertisement
sriyanto

GameManager

Oct 11th, 2022 (edited)
1,080
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. -- Services
  2. local ServerStorage = game:GetService("ServerStorage")
  3. local Players = game:GetService("Players")
  4.  
  5. -- Module Scripts
  6. local moduleScripts = ServerStorage:WaitForChild("ModuleScripts")
  7. local matchManager = require(moduleScripts:WaitForChild("MatchManager"))
  8. local gameSettings = require(moduleScripts:WaitForChild("GameSettings"))
  9. local displayManager = require(moduleScripts:WaitForChild("DisplayManager"))
  10.  
  11. -- Events
  12. local events = ServerStorage:WaitForChild("Events")
  13. local matchEnd = events:WaitForChild("MatchEnd")
  14.  
  15. while true do
  16.     displayManager.updateStatus("Waiting for Players")
  17.  
  18.     repeat
  19.         wait(gameSettings.intermissionDuration)
  20.     until Players.NumPlayers >= gameSettings.minimumPlayers
  21.  
  22.     displayManager.updateStatus("Get ready!")
  23.     wait(gameSettings.transitionTime)
  24.    
  25.     matchManager.prepareGame()
  26.     local endState = matchEnd.Event:Wait()
  27.  
  28.     local endStatus = matchManager.getEndStatus(endState)
  29.     displayManager.updateStatus(endStatus)
  30.  
  31.     matchManager.cleanupMatch()
  32.     wait(gameSettings.transitionTime)
  33.  
  34.     matchManager.resetMatch()
  35. end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement