Any way on optimizing this instead of manually typing each one?

Hi. If there’s any way on optimizing the following script, please let me know.
I’m trying to make a script that automatically destroys a door when a player joins if the player has the right amount of kills. I know you can sorta use v in pairs but I haven’t gotten there yet.

local Players = game:GetService("Players")
local plr = Players.LocalPlayer
local doors = workspace:WaitForChild("Doors")
if doors then
	if plr.leaderstats.Kills.Value >= 75 then
		doors.Door1:Destroy()
		if plr.leaderstats.Kills.Value >= 150 then
			doors.Door2:Destroy()
			if plr.leaderstats.Kills.Value >= 350 then
				doors.Door3:Destroy()
				if plr.leaderstats.Kills.Value >= 550 then
					doors.Door4:Destroy()
					if plr.leaderstats.Kills.Value >= 750 then
						doors.Door5:Destroy()
						if plr.leaderstats.Kills.Value >= 1000 then
							doors.Door6:Destroy()
							if plr.leaderstats.Kills.Value >= 1250 then
								doors.Door7:Destroy()
								if plr.leaderstats.Kills.Value >= 1500 then
									task.wait(1.5) --This door always starts the chain of errors.
									doors:WaitForChild("Door8"):Destroy()
									if plr.leaderstats.Kills.Value >= 2000 then
										doors:WaitForChild("Door9"):Destroy()
										if plr.leaderstats.Kills.Value >= 2750 then
											doors:WaitForChild("Door10"):Destroy()
											if plr.leaderstats.Kills.Value >= 3250 then
												doors:WaitForChild("Door11"):Destroy()
												if plr.leaderstats.Kills.Value >= 3750 then
													doors:WaitForChild("Door12"):Destroy()
													if plr.leaderstats.Kills.Value >= 4250 then
														doors:WaitForChild("Door13"):Destroy()
														if plr.leaderstats.Kills.Value >= 4750 then
															doors:WaitForChild("Door14"):Destroy()
															if plr.leaderstats.Kills.Value >= 5250 then
																doors:WaitForChild("Door15"):Destroy()
																if plr.leaderstats.Kills.Value >= 6250 then
																	doors:WaitForChild("Door16"):Destroy()
																	if plr.leaderstats.Kills.Value >= 7550 then
																		doors:WaitForChild("Door17"):Destroy()
																		if plr.leaderstats.Kills.Value >= 8250 then
																			doors:WaitForChild("Door18"):Destroy()
																			if plr.leaderstats.Kills.Value >= 9250 then
																				doors:WaitForChild("Door19"):Destroy()
																				if plr.leaderstats.Kills.Value >= 10250 then
																					doors:WaitForChild("Door20"):Destroy()
																					if plr.leaderstats.Kills.Value >= 11750 then
																						doors:WaitForChild("Door21"):Destroy()
																						if plr.leaderstats.Kills.Value >= 13250 then
																							doors:WaitForChild("Door22"):Destroy()
																							if plr.leaderstats.Kills.Value >= 15750 then
																								doors:WaitForChild("Door23"):Destroy()
																								if plr.leaderstats.Kills.Value >= 17250 then
																									doors:WaitForChild("Door24"):Destroy()
																									if plr.leaderstats.Kills.Value >= 20750 then
																										doors:WaitForChild("Door25"):Destroy()
																										if plr.leaderstats.Kills.Value >= 22750 then
																											doors:WaitForChild("Door26"):Destroy()
																											if plr.leaderstats.Kills.Value >= 24750 then
																												doors:WaitForChild("Door27"):Destroy()
																												if plr.leaderstats.Kills.Value >= 26750 then
																													doors:WaitForChild("Door28"):Destroy()
																													if plr.leaderstats.Kills.Value >= 28750 then
																														doors:WaitForChild("Door29"):Destroy()
																														if plr.leaderstats.Kills.Value >= 30750 then
																															doors:WaitForChild("Door30"):Destroy()
																															if plr.leaderstats.Kills.Value >= 35750 then
																																doors:WaitForChild("Door31"):Destroy()
																																if plr.leaderstats.Kills.Value >= 40750 then
																																	doors:WaitForChild("Door32"):Destroy()
																																	if plr.leaderstats.Kills.Value >= 50750 then
																																		doors:WaitForChild("Door33"):Destroy()
																																		if plr.leaderstats.Kills.Value >= 60750 then
																																			doors:WaitForChild("Door34"):Destroy()
																																			if plr.leaderstats.Kills.Value >= 70750 then
																																				doors:WaitForChild("Door35"):Destroy()
																																				if plr.leaderstats.Kills.Value >= 80750 then
																																					doors:WaitForChild("Door36"):Destroy()
																																					if plr.leaderstats.Kills.Value >= 95750 then
																																						doors:WaitForChild("Door37"):Destroy()
																																						if plr.leaderstats.Kills.Value >= 110750 then
																																							doors:WaitForChild("Door38"):Destroy()
																																						end
																																					end
																																				end
																																			end
																																		end
																																	end
																																end
																															end
																														end
																													end
																												end
																											end
																										end
																									end
																								end
																							end
																						end
																					end
																				end
																			end
																		end
																	end
																end
															end
														end
													end
												end
											end
										end
									end
								end
							end
						end
					end
				end
			end
		end
end

end

I don’t want to type each if statement manually, if there’s an alternative, that would be helpful. Thanks!

Not sure if it’s ideal, but you could have a table of all the doors and the values to open them, just for example

door_table = {
    Door1 = 75,
    Door2 = 150,
    Door3 = 350,
    -- etc
    -- maybe it would be more ideal to have this in a module script, and just require it in
}

plr_kills = plr.leaderstats.Kills

for door, value in door_table do
    if plr_kills.Value >= value do
        doors[door]:Destroy()
    end
end

completely untested, but i think it should work

you also could store the values in the doors themselves, and then iterate over them. something like this

plr_kills = plr.leaderstats.Kills

for door in doors do
    if plr_kills.Value >= door.Kills.Value do
        door:Destroy()
    end
end

Though you also mentioned you were getting an error on door 8? what’s the error?

Nah, I fixed it at some point.