for i = 1, 41 do local door1 = game.workspace.Doors[tostring(i)].Door1 local scriptName = "???" if door1 then -- Check if a script named "???" exists inside Door1 local scriptInDoor1 = door1:FindFirstChild(scriptName) if scriptInDoor1 then -- If the script exists, set Door1 to Bright green game.workspace.Doors[tostring(i)].Door1.BrickColor = BrickColor.new("Bright green") else -- If Door1 doesn't have the script, set Door2 to Bright green game.workspace.Doors[tostring(i)].Door2.BrickColor = BrickColor.new("Bright green") end end end