Is this script good for round system or not?

Hello, I spent the last 2 hours making a round system script
I want to know if its good or not, So I can use it in my game
The round system is controlled by 1 script, no values
Here is the script:

local RoundTime = 10
local Intermission = 5
local TextButton = script.Parent
local plrs = game.Players:GetChildren()
local Players = game:GetService("Players")


while true do
	local roundTime = RoundTime
	local intermission = Intermission

	while intermission > 0 do
		TextButton.Text = "Round Staring In: " .. intermission
		wait(1)
		intermission = intermission - 1	
	end

	TextButton.Text = "Round Starting"
	wait(3)
	for i = 1, #plrs do
		local num = math.random(1, 4)
		plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position)
	end

	while roundTime > 0 do
		TextButton.Text = "Remaining: " .. roundTime
		wait(1)
		roundTime = roundTime - 1	
	end

	TextButton.Text = "Round Ending"
	wait(3)
	for _, Player in pairs(Players:GetChildren())do
		if Player.Character and Player.Character:FindFirstChild('Humanoid') then
			Player.Character.Humanoid:TakeDamage(100)
		end
	end
end

sorry if its the wrong category

You can use for loops instead of while loops. The rest of the script seems good but instead of resetting the character you can just respawn them using Player:LoadCharacter().

2 Likes