I am working on a game and it is round based. I have a MainGui that says “Waiting for players” and then changes to "Get Ready’ and stays on that until the game is over, and then it shows who the winner is in place of “Get Ready”.
I also have another ScreenGUI that shows time left in the game and players left.
My question is how would one go about hiding the MainGui I described above during game play and only pop up when a winner is chosen and stay up till next round starts?
Here is the localscript I have in the MainGui:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local displayValues = ReplicatedStorage:WaitForChild("DisplayValues")
local status = displayValues:WaitForChild("Status")
local textLabel = script.Parent
local function updateText()
textLabel.Text = status.Value
end
status.Changed:Connect(updateText)
updateText()
Here is my GameManager script located in ServerScriptService:
-- Services
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
-- Module Scripts
local moduleScripts = ServerStorage:WaitForChild("ModuleScripts")
local matchManager = require(moduleScripts:WaitForChild("MatchManager"))
local gameSettings = require(moduleScripts:WaitForChild("GameSettings"))
local displayManager = require(moduleScripts:WaitForChild("DisplayManager"))
-- Events
local events = ServerStorage:WaitForChild("Events")
local matchEnd = events:WaitForChild("MatchEnd")
while true do
displayManager.updateStatus("Waiting for Players")
repeat
wait(gameSettings.intermissionDuration)
until Players.NumPlayers >= gameSettings.minimumPlayers
displayManager.updateStatus("Get ready!")
wait(gameSettings.transitionTime)
matchManager.prepareGame()
local endState = matchEnd.Event:Wait()
local endStatus = matchManager.getEndStatus(endState)
displayManager.updateStatus(endStatus)
matchManager.cleanupMatch()
wait(gameSettings.transitionTime)
matchManager.resetMatch()
end
I am still learning and decided to ask for any hints or tips for me to try.