I have this code (this is only a little of it)

while true do()
		DealDamage.OnServerEvent:Connect(function(MyPlayer, HitPlayer)
			playersLeft.Value = playersLeft.Value - 1
			if playersLeft.Value == 1 then
				ChangeGUITextEvent:FireAllClients(MyPlayer.Name .. " has won!")
			end
		end)
		wait(5)
		ChangeGUITextEvent:FireAllClients("")
		wait(95)
	end

When a player wins I want the while true loop to start over. Is that possible?

3 comments

0

You could put the while loop in a function as call the function when the player wins.but that while loop never  ends 

0

Adding on to @SethHeinzman's answer, you can create a function and put a break at the end to stop it, and then call the function again to start it again.

0

By the way, you don't need parentheses after while true do.