so I made this script and it works in solo but not multiplayer

does anyone have a few fixes?

ps: its a regular script in Workspace

--define vars
local Players = game:GetService("Players")
local maps = game.ServerStorage:GetChildren()
local inprogress = false

--initiate round
while wait(1) do
	if inprogress == false then
		inprogress = true
		for _,player in pairs(Players:GetPlayers()) do
			local Hint = game.ReplicatedStorage:WaitForChild("HintMessage"):Clone()
			Hint.Parent = player.PlayerGui
			Hint.TextHint.Text = "Intermission"
			local randmap = math.random(1, #maps)
			local MapClone = maps[randmap]:Clone()
			wait(4)
			Hint.TextHint.Text = "A map has been chosen!"
			wait(2)
			Hint.TextHint.Text = "Selected map: " .. maps[randmap].Name .. " Map!"
			wait(2)
			Hint.TextHint.Text = "Fight!"
			MapClone.Parent = game.Workspace
			wait(0.5)
			game.Workspace.SpawnLocation.CanCollide = false
			game.Workspace.SpawnLocation.Transparency = 0.4
			wait(5)
			for t = 120, 1, -1 do
				Hint.TextHint.Text = "Time left: " .. t
				wait(1)
			end
			Hint.TextHint.Text = "Game over!"
			wait(3)
			game.Workspace.SpawnLocation.CanCollide = true
			game.Workspace.SpawnLocation.Transparency = 0
			MapClone:Destroy()
			Hint:Destroy()
			inprogress = false
		end
	end
end

1 comment

0

Just to inform you so you don't loose hope I am attempting to find a solution by implementing the methods into my own game. I'll get back to you if I find anything!