So recently I've been working on this game called LAVA RISE, which is pretty much obvious.

I've made this framework script that works; but its only localplayer.

This is my script.


while true do
	wait(1)
	m=script.Parent
s=script.Parent.Parent.TextLabel2

for i=30,1,-1 do
	game.Lighting.Values.CountdownValue.Value = i
	s.Text = "INTERMISSION"
	m.Text=game.Lighting.Values.CountdownValue.Value
	wait(1)
end

s.Text = "Round starting.."
m.Text="Map: Classic"

wait(5)
local players = game.Players:GetChildren()

for i = 1,#players do
	local map = game.Lighting.Maps.Map1
	local extras = map.Extras
	local spwn = extras.Spawn
	local lava = extras.Lava
	
	local plrval = Instance.new("StringValue", game.ReplicatedStorage.Players)
	plrval.Name = players[i].Name
	
	
	game.Workspace:FindFirstChild(players[i].Name):MoveTo(spwn.Position)
	
	lava.Script1.Disabled = false
	lava.Script2.Disabled = false
	
	
end

game.Lighting.Maps.Map1:Clone().Parent = game.Workspace 


script.Parent.Parent.InProgressMusic:Play()
for i=120,1,-1 do
	game.Lighting.Values.CountdownValue.Value = i
	s.Text = "Game in progress."
	m.Text=game.Lighting.Values.CountdownValue.Value
	wait(1)
end

s.Text = "Round ended."
script.Parent.Parent.InProgressMusic:Stop()
game.Workspace.Map1:Destroy()
game.ReplicatedStorage.Players:ClearAllChildren()
wait(10)

end

Very beginner but since there's only one map I really don't care.

I need help on this as I want to get this bug fixed asap.

thanks.

Example of this:

-- 1 player joins a game, works just fine -- another player joins a game during the round -- it teleports everybody to the spawn since the server script is local w/ intermission and text stuff. -- creates another map in a map