This is in workspace.
local minigames=game.Lighting.Maps:GetChildren()
local g=game.StarterGui.ScreenGui.TextBox
local Event = Instance.new('RemoteEvent',game:service("ReplicatedStorage"))
Event.Name = Event
wait(3)
while true do
wait(3)
local players = game:GetService("Players")
local numPlayers = players.NumPlayers
wait(3)
if numPlayers>4 then
wait(3)
g.Visible=true
Event:FireAllClients('Chosing Map')
ranGame=math.random(1,#minigames)
gamechosen=minigames[ranGame]
Event:FireAllClients('The Round For This Round Will be'..gamechosen.Name)
wait(3)
gamechosenclone=gamechosen:Clone()
gamechosenclone.Parent=game.Workspace
for i=10,1,-1 do
wait(3)
Event:FireAllClients('Time Left'..i)
end
Event:FireAllClients('Game Ended')
wait(3)
gamechosenclone:Destroy()
else
g.Visible=true
Event:FireAllClients('There Needs To Be At Least 4 Players To Start')
end
end
Local Script:This is in StarterGui.ScreenGui.TextBox
local RepStorage = game:GetService("ReplicatedStorage")
local Event = RepStorage:WaitForChild("Event")
local GUI = script.Parent
local textframe = GUI:WaitForChild("TextBox")
Event.OnClientEvent:connect(function(text)
textframe.Text = text
end)
