Advertisement
sriyanto

DisplayManager

Oct 11th, 2022
1,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local DisplayManager = {}
  2.  
  3. -- Services
  4. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  5.  
  6. -- Display Values used to update Player GUI
  7. local displayValues = ReplicatedStorage:WaitForChild("DisplayValues")
  8. local status = displayValues:WaitForChild("Status")
  9. local playersLeft = displayValues:WaitForChild("PlayersLeft")
  10. local timeLeft = displayValues:WaitForChild("TimeLeft")
  11.  
  12. -- Local Functions
  13. local function updateRoundStatus()
  14.     status.Value = "Players Left: " .. playersLeft.Value .. " / Time Left: " .. timeLeft.Value
  15. end
  16.  
  17. -- Module Functions
  18. function DisplayManager.updateStatus(newStatus)
  19.     status.Value = newStatus
  20. end
  21.  
  22. playersLeft.Changed:Connect(updateRoundStatus)
  23. timeLeft.Changed:Connect(updateRoundStatus)
  24.  
  25. return DisplayManager
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement