Exhaustion allowed execution time

Instead of placing wait in the if parttodelete = “landpart” just put it outside. Sorry for the lackluster explanation i am on mobile but… You want to do something like

repeat
Wait(inserttimehere)
If partname == landpart then
End
Until partname == landpart

Or something and also have an or in there so the loop doesnt get stuck forever for some reason.

It froze again:

repeat
		wait(1)
		timer -= 1
		Status.Value = "Round starting in "..timer
	until timer == 0
	local PartToDelete

	for count = 1, #Map:GetChildren() do 
		timer = tonumber(#Map:GetChildren())
		timer -= 1
		Status.Value = "Round Time left: "..timer
		local ChildrenOfModel = Map:GetChildren()
		PartToDelete = ChildrenOfModel[math.random(#ChildrenOfModel)]
		wait(1)
		if PartToDelete.Name == "LandPart" then 
			PartToDelete.Material = Enum.Material.Neon
			PartToDelete.BrickColor = BrickColor.new("Really red")
			wait(time_between_destroy)
			PartToDelete:Destroy()
		else
			repeat 
				PartToDelete = ChildrenOfModel[math.random(#ChildrenOfModel)] 
				if PartToDelete.Name == "LandPart" then 
					PartToDelete.Material = Enum.Material.Neon
					PartToDelete.BrickColor = BrickColor.new("Really red")
					wait(time_between_destroy)
					PartToDelete:Destroy()
				end
			until PartToDelete.Name == "LandPart"

Hey i’m back on my computer now… But your going to want to do something like this…

		repeat wait() 
			PartToDelete = ChildrenOfModel[math.random(#ChildrenOfModel)] 
			if PartToDelete.Name == "LandPart" then 
				PartToDelete.Material = Enum.Material.Neon
				PartToDelete.BrickColor = BrickColor.new("Really red")
				wait(time_between_destroy)
				PartToDelete:Destroy()
			end
		until PartToDelete.Name == "LandPart"

as @granday_electronics suggested you do

2 Likes