Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's wrong with my intermission script? It break when round ends! Help!

function ChooseDuelers()
	repeat wait() until game.Players.NumPlayers >=2
	for i = 20, 0, -1 do
		script.Lobby:Play()
		h = Instance.new("Hint",workspace)
		h.Text = "Round starting in: " ..i
		wait(1)
		h:Destroy()
	end
	local Players=Game.Players:GetPlayers() 
	local Chosen1, Chosen2 = math.random(1, #Players), 0
	repeat Chosen2 = math.random(1, #Players) until Chosen2 ~= Chosen1
	m = Instance.new("Message",workspace)
	m.Text = Players[Chosen1].Name.. " and " ..Players[Chosen2].Name.. " have been chosen!"
	wait(3)
	Players[Chosen1].Character:MoveTo(Vector3.new(game.Workspace.Tele1.Position))
	Players[Chosen2].Character:MoveTo(Vector3.new(game.Workspace.Tele2.Position))
	m.Text = "Duelers teleported, starting round."
	wait(3)
	m:Destroy()
	local chosen1 = game.Lighting.Chosen1:clone()
	chosen1.Parent = Players[Chosen1].Backpack
	local chosen2 = game.Lighting.Chosen2:clone()
	chosen2.Parent = Players[Chosen2].Backpack
	Players[Chosen1].Character.Humanoid.WalkSpeed = 0
	Players[Chosen2].Character.Humanoid.WalkSpeed = 0
	for i = 3, 0, -1 do
		m.Text = "Round starting in: " ..i
		wait(1)
	end
	for i = 30, 0, -1 do
		script.Lobby:Stop()
		script.Battle:Play()
		Players[Chosen1].Character.Humanoid.WalkSpeed = 16
	    Players[Chosen2].Character.Humanoid.WalkSpeed = 16
		h = Instance.new("Hint",workspace)
		h.Text = "New round in: " ..i
		wait(1)
		if Players[Chosen1].Character.Humanoid.Health == 0 then
			h:Destroy()
			m = Instance.new("Message",workspace)
			m.Text = Players[Chosen2].Name.. " won!"
			wait(3)
			m:Destroy()
			Players[Chosen2].Character:MoveTo(Vector3.new(game.Workspace.won.Position))
		end
		if Players[Chosen2].Character.Humanoid.Health == 0 then
			h:Destroy()
			m = Instance.new("Message",workspace)
			m.Text = Players[Chosen1].Name.. " won!"
			wait(3)
			m:Destroy()
			Players[Chosen1].Character:MoveTo(Vector3.new(game.Workspace.won.Position))
			script.Battle:Stop()
		end
	end
end

ChooseDuelers()

3 comments

0

Before I get into it, what doesn't work with it?

0

Well, when a round ends, the intermission won't work. The looping breaks and such.

0

Any output?

1 answer

Post output. We can not "help" if you do not give us anything. saying "OMG HELP IT NO WORK" will not get you help.

This discussion is preserved as it was. New answers, comments, and votes are closed.