-Local script in StarterGui>ScreenGui>Frame>TextLabel

local function intermission ()
	script.Parent.Text = 30
	for i=1,30 do
		wait(1)
		script.Parent.Text = script.Parent.Text - 1
	end
	workspace.Events.start:FireServer()
end

workspace.Events.intermission.OnClientEvent:Connect(intermission)

local function start ()
	script.Parent.Text = 120
	for i=1,120 do
		wait(1)
		script.Parent.Text = script.Parent.Text - 1
	end
	workspace.Events.intermission:FireServer()
end

workspace.Events.start.OnClientEvent:Connect(start)

-3 script inside Workspace>Events(folder)

wait(5)
script.Parent.intermission:FireAllClients()

-Script is named "Begin"

local function start ()
	local map = game:GetService("ServerStorage").Map.DissapearingPlatforms:Clone()
	map.Parent = workspace
	local target = CFrame.new(0, 69.5, 60)
		for i, player in ipairs(game.Players:GetChildren()) do
			if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
      			player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
			end
		end
	script.Parent.start:FireAllClients()
end


script.Parent.start.OnServerEvent:Connect(start)

-Script is named "Start"

local function restart ()
	workspace.DissapearingPlatforms:Destroy()
	for _,v in pairs(game.Players:GetPlayers()) do
		v:LoadCharacter()
	end
	script.Parent.intermission:FireAllClients()
end

script.Parent.intermission.OnServerEvent:Connect(restart)

-Script is named "Restart"

So i don't know how to make the "local function start ()" in local script stop if only one player or none is left, also sometimes the timer gets broken and puts non-random negative numbers but the functions still works.

4 comments

0

Can you explain this in more detain and include your script?

0

Sure wait.

0

I can help you out more if you include an outline script of the idea you're going for, but for now I'd do something like "while players > 1 then"

0

i think i can do it by making numbers of player once the games starts and put "if _ > 1 then"